Re: [PATCH] sched, fair: try to prevent migration thread from preempting non-cfs task
From: Yafang Shao
Date: Wed Jun 16 2021 - 05:49:48 EST
On Wed, Jun 16, 2021 at 4:29 PM Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
>
> On Wed, Jun 16, 2021 at 09:29:55AM +0200, Vincent Guittot wrote:
> > On Wed, 16 Jun 2021 at 09:15, Peter Zijlstra <peterz@xxxxxxxxxxxxx> wrote:
>
> > > The suggestion was adding a cfs_migration thread, specifically for
> > > active balance (and maybe numa). Just not sure the cost of carrying yet
> > > another per-cpu kernel thread is worth the benefit.
> >
> > Also, this will not completely remove the problem but only further
> > reduce the race window because the rq is locked and the irq disable in
> > active_load_balance_cpu_stop().
>
> It removes the problem of active migration interfering with this
> worklaod, because the FIFO1 task will never run until that is done
> (assuming he manages to not have his workload at FIFO1).
>
Right, the workload should have a higher priority than FIFO1 then.
I'm wondering why not just setting some flags to the running CFS and
then when the CFS task scheds out the CPU we migrate it to the new
idle CPU in active LB. Then we don't need to preempt any task.
--
Thanks
Yafang