]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
smp: enhance power efficiency
authorSumit Singh <sumsingh@nvidia.com>
Mon, 21 Apr 2014 05:39:58 +0000 (11:09 +0530)
committerMandar Padmawar <mpadmawar@nvidia.com>
Tue, 24 Jun 2014 11:48:06 +0000 (04:48 -0700)
Here we are trying to reduce power usage through the
use of macros cpu_relaxed_read_short and cpu_relaxed_read.

Bug 1440421

Change-Id: I114d122cf58b1cf7b93b4b5f5d712360a2f1e096
Signed-off-by: Sumit Singh <sumsingh@nvidia.com>
Reviewed-on: http://git-master/r/425947
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Sri Krishna Chowdary <schowdary@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alexander Van Brunt <avanbrunt@nvidia.com>
kernel/smp.c

index 5221ac677e608daf3d44aa73f088e08d5e5cb564..1acf2bd32dbe1ce28246f29b92e3249222389373 100644 (file)
@@ -2,6 +2,7 @@
  * Generic helpers for smp ipi calls
  *
  * (C) Jens Axboe <jens.axboe@oracle.com> 2008
+ * Copyright (c) 2014, NVIDIA CORPORATION.  All rights reserved.
  */
 #include <linux/rcupdate.h>
 #include <linux/rculist.h>
@@ -12,6 +13,7 @@
 #include <linux/gfp.h>
 #include <linux/smp.h>
 #include <linux/cpu.h>
+#include <asm/relaxed.h>
 
 #include "smpboot.h"
 
@@ -101,8 +103,8 @@ void __init call_function_init(void)
  */
 static void csd_lock_wait(struct call_single_data *csd)
 {
-       while (csd->flags & CSD_FLAG_LOCK)
-               cpu_relax();
+       while (cpu_relaxed_read_short(&csd->flags) & CSD_FLAG_LOCK)
+               cpu_read_relax();
 }
 
 static void csd_lock(struct call_single_data *csd)