For the learned ..... Adding as a point to start with .. no guarantees that this is the Saviour .... just a lead to who can get the heads and tails out of it
# diff -cp tick-sched.c(2.6.37-rc4) tick-sched.c(2.6.25-23)
...
*** tick.sched-2.6.37-rc4.c 2010-12-06 17:50:03.960025002 +0530 --- tick-sched-2.6.35-23.c 2010-11-18 03:45:19.000000000 +0530 *************** void tick_nohz_stop_sched_tick(int inidl *** 405,411 **** * the scheduler tick in nohz_restart_sched_tick. */ if (!ts->tick_stopped) { ! select_nohz_load_balancer(1);
ts->idle_tick = hrtimer_get_expires(&ts->sched_timer); ts->tick_stopped = 1; --- 405,417 ---- * the scheduler tick in nohz_restart_sched_tick. */ if (!ts->tick_stopped) { ! if (select_nohz_load_balancer(1)) { ! /* ! * sched tick not stopped! ! */ ! cpumask_clear_cpu(cpu, nohz_cpu_mask); ! goto out; ! }
ts->idle_tick = hrtimer_get_expires(&ts->sched_timer); ts->tick_stopped = 1; *************** void tick_setup_sched_timer(void) *** 774,779 **** --- 780,786 ---- { struct tick_sched *ts = &__get_cpu_var(tick_cpu_sched); ktime_t now = ktime_get(); + u64 offset;
/* * Emulate tick processing via per-CPU hrtimers: *************** void tick_setup_sched_timer(void) *** 783,788 **** --- 790,799 ----
/* Get the next period (per cpu) */ hrtimer_set_expires(&ts->sched_timer, tick_init_jiffy_update()); + offset = ktime_to_ns(tick_period) >> 1; + do_div(offset, num_possible_cpus()); + offset *= smp_processor_id(); + hrtimer_add_expires_ns(&ts->sched_timer, offset);
for (;;) { hrtimer_forward(&ts->sched_timer, now, tick_period);
For the learned .....
Adding as a point to start with .. no guarantees that this is the Saviour .... just a lead to who can get the heads and tails out of it
# diff -cp tick-sched. c(2.6.37- rc4) tick-sched. c(2.6.25- 23)
...
*** tick.sched- 2.6.37- rc4.c 2010-12-06 17:50:03.960025002 +0530 2.6.35- 23.c 2010-11-18 03:45:19.000000000 +0530 stop_sched_ tick(int inidl sched_tick. nohz_load_ balancer( 1);
--- tick-sched-
*************** void tick_nohz_
*** 405,411 ****
* the scheduler tick in nohz_restart_
*/
if (!ts->tick_stopped) {
! select_
ts->idle_tick = hrtimer_ get_expires( &ts->sched_ timer); >tick_stopped = 1; sched_tick. nohz_load_ balancer( 1)) { clear_cpu( cpu, nohz_cpu_mask);
ts-
--- 405,417 ----
* the scheduler tick in nohz_restart_
*/
if (!ts->tick_stopped) {
! if (select_
! /*
! * sched tick not stopped!
! */
! cpumask_
! goto out;
! }
ts->idle_tick = hrtimer_ get_expires( &ts->sched_ timer); >tick_stopped = 1; sched_timer( void) cpu_var( tick_cpu_ sched);
ts-
*************** void tick_setup_
*** 774,779 ****
--- 780,786 ----
{
struct tick_sched *ts = &__get_
ktime_t now = ktime_get();
+ u64 offset;
/* sched_timer( void)
* Emulate tick processing via per-CPU hrtimers:
*************** void tick_setup_
*** 783,788 ****
--- 790,799 ----
/* Get the next period (per cpu) */ set_expires( &ts->sched_ timer, tick_init_ jiffy_update( )); ns(tick_ period) >> 1; cpus()) ; add_expires_ ns(&ts- >sched_ timer, offset);
hrtimer_
+ offset = ktime_to_
+ do_div(offset, num_possible_
+ offset *= smp_processor_id();
+ hrtimer_
for (;;) { forward( &ts->sched_ timer, now, tick_period);
hrtimer_