Re: [patch] HT scheduler, sched-2.5.59-E2

Erich Focht
2003-02-04T09:21:35Z

Hi Ingo,

On Monday 03 February 2003 19:23, Ingo Molnar wrote:
> -#define
> CAN_MIGRATE_TASK(p,rq,this_cpu) \
> - ((jiffies - (p)->sleep_timestamp > cache_decay_ticks) && \
> - !task_running(rq, p) && \
> - ((p)->cpus_allowed & (1UL << (this_cpu)))) +#define
> CAN_MIGRATE_TASK(p,rq,cpu) \
> + ((idle || (jiffies - (p)->last_run > cache_decay_ticks)) && \
> + !task_running(p) && task_allowed(p, cpu))

at least for NUMA systems this is too aggressive (though I believe
normal SMP systems could be hurt, too).

The problem: freshly forked tasks are stolen by idle cpus on the same
node before they exec. This actually disables the sched_balance_exec()
mechanism as the tasks to be balanced already run alone on other
CPUs. Which means: the whole benefit of having balanced nodes
(maximize the memory bandwidth) is gone.

The change below is less aggressive but in the same philosophy. Could
you please take it instead?

> CAN_MIGRATE_TASK(p,rq,cpu) \
> + ((jiffies - (p)->last_run > (cache_decay_ticks >> idle)) && \
> + !task_running(p) && task_allowed(p, cpu))

Regards,
Erich