cpu: enhance power efficiency
Sumit Singh [Mon, 21 Apr 2014 09:59:54 +0000 (14:59 +0530)]
Here we are trying to reduce power usage through the
use of macros cpu_relaxed_read and relaxed version of
idle_cpu().

Bug 1440421

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

kernel/cpu.c

index 9dd31fa..43f6fcf 100644 (file)
@@ -328,8 +328,8 @@ static int __ref _cpu_down(unsigned int cpu, int tasks_frozen)
         *
         * Wait for the stop thread to go away.
         */
-       while (!idle_cpu(cpu))
-               cpu_relax();
+       while (!idle_cpu_relaxed(cpu))
+               cpu_read_relax();
 
        /* This actually kills the CPU. */
        __cpu_die(cpu);