Re: [PATCH] sched: Do not release current rq lock on non contended double_lock_balance()

From: Peter Zijlstra
Date: Wed Jun 15 2016 - 07:15:10 EST


On Tue, Jun 14, 2016 at 02:02:28PM -0400, Steven Rostedt wrote:
> > For instance; pull_rt_task() does:
> >
> > for_each_cpu() {
> > double_lock_balance(this, that);
> > ...
> > double_unlock_balance(this, that);
> > }
> >
> > Which, with the trylock, ends up with a max possible hold time of
> > O(nr_cpus).
>
> Sure, but I think we should try to limit that loop too, because that
> loop itself is what is triggering the large latency for me, because
> it constantly releases a spinlock and has to wait. This loop is done
> with preemption disabled.

OK, so should not the whole HAVE_RT_PUSH_IPI thing have avoided that
loop entirely? And therefore made the point moot?

In any case, can't we add another cpupri for pushable tasks and use that
to find the highest priority task to pull and avoid the loop thus?