tick-sched.c (2bbb6817c0ac1b5f2a68d720f364f98eeb1ac4fd) | tick-sched.c (1268fbc746ea1cd279886a740dcbad4ba5232225) |
---|---|
1/* 2 * linux/kernel/time/tick-sched.c 3 * 4 * Copyright(C) 2005-2006, Thomas Gleixner <tglx@linutronix.de> 5 * Copyright(C) 2005-2007, Red Hat, Inc., Ingo Molnar 6 * Copyright(C) 2006-2007 Timesys Corp., Thomas Gleixner 7 * 8 * No idle tick implementation for low and high resolution timers --- 440 unchanged lines hidden (view full) --- 449} 450 451/** 452 * tick_nohz_idle_enter - stop the idle tick from the idle task 453 * 454 * When the next event is more than a tick into the future, stop the idle tick 455 * Called when we start the idle loop. 456 * | 1/* 2 * linux/kernel/time/tick-sched.c 3 * 4 * Copyright(C) 2005-2006, Thomas Gleixner <tglx@linutronix.de> 5 * Copyright(C) 2005-2007, Red Hat, Inc., Ingo Molnar 6 * Copyright(C) 2006-2007 Timesys Corp., Thomas Gleixner 7 * 8 * No idle tick implementation for low and high resolution timers --- 440 unchanged lines hidden (view full) --- 449} 450 451/** 452 * tick_nohz_idle_enter - stop the idle tick from the idle task 453 * 454 * When the next event is more than a tick into the future, stop the idle tick 455 * Called when we start the idle loop. 456 * |
457 * If no use of RCU is made in the idle loop between 458 * tick_nohz_idle_enter() and tick_nohz_idle_exit() calls, then 459 * tick_nohz_idle_enter_norcu() should be called instead and the arch 460 * doesn't need to call rcu_idle_enter() and rcu_idle_exit() explicitly. | 457 * The arch is responsible of calling: |
461 * | 458 * |
462 * Otherwise the arch is responsible of calling: 463 * | |
464 * - rcu_idle_enter() after its last use of RCU before the CPU is put 465 * to sleep. 466 * - rcu_idle_exit() before the first use of RCU after the CPU is woken up. 467 */ | 459 * - rcu_idle_enter() after its last use of RCU before the CPU is put 460 * to sleep. 461 * - rcu_idle_exit() before the first use of RCU after the CPU is woken up. 462 */ |
468void __tick_nohz_idle_enter(void) | 463void tick_nohz_idle_enter(void) |
469{ 470 struct tick_sched *ts; 471 | 464{ 465 struct tick_sched *ts; 466 |
467 WARN_ON_ONCE(irqs_disabled()); 468 469 local_irq_disable(); 470 |
|
472 ts = &__get_cpu_var(tick_cpu_sched); 473 /* 474 * set ts->inidle unconditionally. even if the system did not 475 * switch to nohz mode the cpu frequency governers rely on the 476 * update of the idle time accounting in tick_nohz_start_idle(). 477 */ 478 ts->inidle = 1; 479 tick_nohz_stop_sched_tick(ts); | 471 ts = &__get_cpu_var(tick_cpu_sched); 472 /* 473 * set ts->inidle unconditionally. even if the system did not 474 * switch to nohz mode the cpu frequency governers rely on the 475 * update of the idle time accounting in tick_nohz_start_idle(). 476 */ 477 ts->inidle = 1; 478 tick_nohz_stop_sched_tick(ts); |
479 480 local_irq_enable(); |
|
480} 481 482/** 483 * tick_nohz_irq_exit - update next tick event from interrupt exit 484 * 485 * When an interrupt fires while we are idle and it doesn't cause 486 * a reschedule, it may still add, modify or delete a timer, enqueue 487 * an RCU callback, etc... --- 419 unchanged lines hidden --- | 481} 482 483/** 484 * tick_nohz_irq_exit - update next tick event from interrupt exit 485 * 486 * When an interrupt fires while we are idle and it doesn't cause 487 * a reschedule, it may still add, modify or delete a timer, enqueue 488 * an RCU callback, etc... --- 419 unchanged lines hidden --- |