Re: single aio thread is migrated crazily by scheduler

From: Srikar Dronamraju
Date: Mon Dec 09 2019 - 11:51:37 EST


* Peter Zijlstra <peterz@xxxxxxxxxxxxx> [2019-11-21 14:29:37]:

> On Wed, Nov 20, 2019 at 05:03:13PM -0500, Phil Auld wrote:
> > On Wed, Nov 20, 2019 at 08:16:36PM +0100 Peter Zijlstra wrote:
> > > On Tue, Nov 19, 2019 at 07:40:54AM +1100, Dave Chinner wrote:
>
> > > > Yes, that's precisely the problem - work is queued, by default, on a
> > > > specific CPU and it will wait for a kworker that is pinned to that
> > >
> > > I'm thinking the problem is that it doesn't wait. If it went and waited
> > > for it, active balance wouldn't be needed, that only works on active
> > > tasks.
> >
> > Since this is AIO I wonder if it should queue_work on a nearby cpu by
> > default instead of unbound.
>
> The thing seems to be that 'unbound' is in fact 'bound'. Maybe we should
> fix that. If the load-balancer were allowed to move the kworker around
> when it didn't get time to run, that would probably be a better
> solution.
>

Can the scheduler detect this situation and probably preempt the current
task?

----->8-------------------------------------------8<------------------