From: Thomas Gleixner <>
Subject: sched: Limit the number of task migrations per batch on RT
Date: Tue, 28 Sep 2021 14:24:25 +0200

Batched task migrations are a source for large latencies as they keep the
scheduler from running while processing the migrations.

Limit the batch size to 8 instead of 32 when running on a RT enabled

Signed-off-by: Thomas Gleixner <>
Signed-off-by: Sebastian Andrzej Siewior <>
 kernel/sched/core.c |    4 ++++
 1 file changed, 4 insertions(+)
@ kernel/sched/core.c:77 @ const_debug unsigned int sysctl_sched_fe
  * Number of tasks to iterate in a single balance run.
  * Limited because this is done with IRQs disabled.
+const_debug unsigned int sysctl_sched_nr_migrate = 8;
 const_debug unsigned int sysctl_sched_nr_migrate = 32;
  * period over which we measure -rt task CPU usage in us.