linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/4] sched: Introduce cfs_migration
@ 2021-11-04 14:57 Yafang Shao
  2021-11-04 14:57 ` [RFC PATCH 1/4] stop_machine: Move cpu_stop_done into stop_machine.h Yafang Shao
                   ` (4 more replies)
  0 siblings, 5 replies; 16+ messages in thread
From: Yafang Shao @ 2021-11-04 14:57 UTC (permalink / raw)
  To: mingo, peterz, juri.lelli, vincent.guittot, dietmar.eggemann,
	rostedt, bsegall, mgorman, bristot
  Cc: linux-kernel, Yafang Shao

The active load balance has a known issue[1][2] that there is a race
window between waking up the migration thread on the busiest CPU and it
begins to preempt the current running CFS task. This race window may cause
unexpected behavior that the current running CFS task may be preempted
by a RT task first, and then the RT task will be preempted by this
waked migration thread. Per our tracing, the latency caused by this
preemption can be greater than 1ms, which is not a small latency for the
RT tasks.

We'd better set a proper priority to this balance work so that it can
preempt CFS task only. A new per-cpu thread cfs_migration is introduced
for this purpose. The cfs_migration thread has a priority FIFO-1,
which means it can preempt any cfs tasks but can't preempt other FIFO
tasks.

Besides the active load balance work, the numa balance work also applies
to CFS tasks only. So we'd better assign cfs_migraion to numa balance
work as well.

[1]. https://lore.kernel.org/lkml/CAKfTPtBygNcVewbb0GQOP5xxO96am3YeTZNP5dK9BxKHJJAL-g@mail.gmail.com/
[2]. https://lore.kernel.org/lkml/20210615121551.31138-1-laoar.shao@gmail.com/

Yafang Shao (4):
  stop_machine: Move cpu_stop_done into stop_machine.h
  sched/fair: Introduce cfs_migration
  sched/fair: Do active load balance in cfs_migration
  sched/core: Do numa balance in cfs_migration

 include/linux/stop_machine.h |  12 +++
 kernel/sched/core.c          |   2 +-
 kernel/sched/fair.c          | 143 ++++++++++++++++++++++++++++++++++-
 kernel/sched/sched.h         |   2 +
 kernel/stop_machine.c        |  14 +---
 5 files changed, 158 insertions(+), 15 deletions(-)

-- 
2.17.1


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2021-11-10 14:18 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-04 14:57 [RFC PATCH 0/4] sched: Introduce cfs_migration Yafang Shao
2021-11-04 14:57 ` [RFC PATCH 1/4] stop_machine: Move cpu_stop_done into stop_machine.h Yafang Shao
2021-11-05 17:00   ` Valentin Schneider
2021-11-06  7:30     ` Yafang Shao
2021-11-04 14:57 ` [RFC PATCH 2/4] sched/fair: Introduce cfs_migration Yafang Shao
2021-11-05 17:01   ` Valentin Schneider
2021-11-06  7:40     ` Yafang Shao
2021-11-09 10:47       ` Valentin Schneider
2021-11-10 14:17         ` Yafang Shao
2021-11-07  9:38   ` [sched/fair] 64228563c2: WARNING:at_kernel/kthread.c:#__kthread_bind_mask kernel test robot
2021-11-08  3:53     ` Yafang Shao
2021-11-04 14:57 ` [RFC PATCH 3/4] sched/fair: Do active load balance in cfs_migration Yafang Shao
2021-11-04 14:57 ` [RFC PATCH 4/4] sched/core: Do numa " Yafang Shao
2021-11-05 17:02   ` Valentin Schneider
2021-11-06  7:40     ` Yafang Shao
2021-11-05 17:00 ` [RFC PATCH 0/4] sched: Introduce cfs_migration Valentin Schneider

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).