Re: cond_resched() and RCU CPU stall warnings

From: Mike Galbraith
Date: Sun Mar 16 2014 - 03:30:35 EST


On Sat, 2014-03-15 at 23:25 -0700, Paul E. McKenney wrote:
> On Sun, Mar 16, 2014 at 07:09:42AM +0100, Mike Galbraith wrote:

> > Hm. Since you only care about the case where your task is solo, how
> > about do racy checks, 100% accuracy isn't required is it? Seems you
> > wouldn't want to unconditionally do that in tight loops.
>
> And indeed, my current workaround unconditionally does schedule() one
> out of 256 loops. I would do something similar here, perhaps based
> on per-CPU counters, perhaps even with racy accesses to avoid always
> doing preempt_disable()/preempt_enable().
>
> Or did you have something else in mind?

Exactly what I meant, take a racy peek or two first.

-Mike

--
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/