summaryrefslogtreecommitdiff
path: root/kernel
diff options
context:
space:
mode:
authorSumit Singh <sumsingh@nvidia.com>2014-04-21 11:09:58 +0530
committerMandar Padmawar <mpadmawar@nvidia.com>2014-06-24 04:48:06 -0700
commitc59d2989479d6431f4e83e2829c6cf25fc3f1184 (patch)
tree799b81e91b2a3a15e3164a408ff99e8c340b17a4 /kernel
parent0d1081f5f2a34f082deac2590835cd7bf15bedef (diff)
smp: enhance power efficiency
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>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/smp.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/kernel/smp.c b/kernel/smp.c
index 5221ac677e60..1acf2bd32dbe 100644
--- a/kernel/smp.c
+++ b/kernel/smp.c
@@ -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)