Re: [PATCH] sched: avoid large irq-latencies in smp-balancing

From: DM
Date: Fri Nov 09 2007 - 07:42:11 EST


Peter Zijlstra <peterz <at> infradead.org> writes:
> @@ -2237,7 +2243,7 @@ balance_tasks(struct rq *this_rq, int th
> enum cpu_idle_type idle, int *all_pinned,
> int *this_best_prio, struct rq_iterator *iterator)
> {
> - int pulled = 0, pinned = 0, skip_for_load;
> + int loops = 0, pulled = 0, pinned = 0, skip_for_load;
> struct task_struct *p;
> long rem_load_move = max_load_move;
>
> @@ -2251,10 +2257,10 @@ balance_tasks(struct rq *this_rq, int th
> */
> p = iterator->start(iterator->arg);
> next:
> - if (!p)
> + if (!p || loops++ > sysctl_sched_nr_migrate)
> goto out;

Looks to me like an off-by-one thingy. If sysctl_sched_nr_migrate is zero we
can still migrate one task. Feature or bug?

/dm


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/