From c59d2989479d6431f4e83e2829c6cf25fc3f1184 Mon Sep 17 00:00:00 2001 From: Sumit Singh Date: Mon, 21 Apr 2014 11:09:58 +0530 Subject: 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 Reviewed-on: http://git-master/r/425947 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Sri Krishna Chowdary GVS: Gerrit_Virtual_Submit Reviewed-by: Alexander Van Brunt --- kernel/smp.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'kernel') 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 2008 + * Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved. */ #include #include @@ -12,6 +13,7 @@ #include #include #include +#include #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) -- cgit v1.2.3