idle.c (5c34202b8bf942da411b6599668a76b07449bbfd) | idle.c (1ad749980a5fda46f7ec920d8409ddcc89b38714) |
---|---|
1/* 2 * Idle daemon for PowerPC. Idle daemon will handle any action 3 * that needs to be taken when the system becomes idle. 4 * 5 * Originally written by Cort Dougan (cort@cs.nmt.edu). 6 * Subsequent 32-bit hacking by Tom Rini, Armin Kuster, 7 * Paul Mackerras and others. 8 * --- 10 unchanged lines hidden (view full) --- 19 * 2 of the License, or (at your option) any later version. 20 */ 21 22#include <linux/sched.h> 23#include <linux/kernel.h> 24#include <linux/smp.h> 25#include <linux/cpu.h> 26#include <linux/sysctl.h> | 1/* 2 * Idle daemon for PowerPC. Idle daemon will handle any action 3 * that needs to be taken when the system becomes idle. 4 * 5 * Originally written by Cort Dougan (cort@cs.nmt.edu). 6 * Subsequent 32-bit hacking by Tom Rini, Armin Kuster, 7 * Paul Mackerras and others. 8 * --- 10 unchanged lines hidden (view full) --- 19 * 2 of the License, or (at your option) any later version. 20 */ 21 22#include <linux/sched.h> 23#include <linux/kernel.h> 24#include <linux/smp.h> 25#include <linux/cpu.h> 26#include <linux/sysctl.h> |
27#include <linux/tick.h> |
|
27 28#include <asm/system.h> 29#include <asm/processor.h> 30#include <asm/cputable.h> 31#include <asm/time.h> 32#include <asm/machdep.h> 33#include <asm/smp.h> 34 --- 19 unchanged lines hidden (view full) --- 54 */ 55void cpu_idle(void) 56{ 57 if (ppc_md.idle_loop) 58 ppc_md.idle_loop(); /* doesn't return */ 59 60 set_thread_flag(TIF_POLLING_NRFLAG); 61 while (1) { | 28 29#include <asm/system.h> 30#include <asm/processor.h> 31#include <asm/cputable.h> 32#include <asm/time.h> 33#include <asm/machdep.h> 34#include <asm/smp.h> 35 --- 19 unchanged lines hidden (view full) --- 55 */ 56void cpu_idle(void) 57{ 58 if (ppc_md.idle_loop) 59 ppc_md.idle_loop(); /* doesn't return */ 60 61 set_thread_flag(TIF_POLLING_NRFLAG); 62 while (1) { |
63 tick_nohz_stop_sched_tick(); |
|
62 while (!need_resched() && !cpu_should_die()) { 63 ppc64_runlatch_off(); 64 65 if (ppc_md.power_save) { 66 clear_thread_flag(TIF_POLLING_NRFLAG); 67 /* 68 * smp_mb is so clearing of TIF_POLLING_NRFLAG 69 * is ordered w.r.t. need_resched() test. --- 15 unchanged lines hidden (view full) --- 85 */ 86 HMT_low(); 87 HMT_very_low(); 88 } 89 } 90 91 HMT_medium(); 92 ppc64_runlatch_on(); | 64 while (!need_resched() && !cpu_should_die()) { 65 ppc64_runlatch_off(); 66 67 if (ppc_md.power_save) { 68 clear_thread_flag(TIF_POLLING_NRFLAG); 69 /* 70 * smp_mb is so clearing of TIF_POLLING_NRFLAG 71 * is ordered w.r.t. need_resched() test. --- 15 unchanged lines hidden (view full) --- 87 */ 88 HMT_low(); 89 HMT_very_low(); 90 } 91 } 92 93 HMT_medium(); 94 ppc64_runlatch_on(); |
95 tick_nohz_restart_sched_tick(); |
|
93 if (cpu_should_die()) 94 cpu_die(); 95 preempt_enable_no_resched(); 96 schedule(); 97 preempt_disable(); 98 } 99} 100 --- 36 unchanged lines hidden --- | 96 if (cpu_should_die()) 97 cpu_die(); 98 preempt_enable_no_resched(); 99 schedule(); 100 preempt_disable(); 101 } 102} 103 --- 36 unchanged lines hidden --- |