Re: [PATCH v1] sched: fix nohz idle load balancer issues

From: Peter Zijlstra
Date: Thu Sep 29 2011 - 04:16:48 EST


On Wed, 2011-09-28 at 17:47 -0700, Suresh Siddha wrote:
> So ended up with using kick_process() and the scheduler_ipi() context to
> trigger the SCHED_SOFTIRQ instead of using smp call function vector
> sequence (which has a deadlock scenario in the context of heavy
> interrupts which I can explain in detail when I send the complete
> changelog). And also I am explicitly requesting for idle balance to
> address the stale idle_at_tick condition.

I'd be interested in hearing more about that deadlock, because when
allocating your own csd and not waiting for the result
__smp_call_function_single() should be deadlock free.

> @@ -2733,6 +2733,11 @@ void scheduler_ipi(void)
> struct rq *rq = this_rq();
> struct task_struct *list = xchg(&rq->wake_list, NULL);
>
> + if (unlikely((rq->idle == current) && rq->nohz_balance_kick)) {
> + rq->idle_balance = 1;
> + raise_softirq_irqoff(SCHED_SOFTIRQ);
> + }

This can end up being outside of irq_enter()/irq_exit(), which is
probably not what you want. See the somewhat large comment right below
here.
--
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/