mirror of
https://github.com/torvalds/linux.git
synced 2026-08-01 03:59:40 +02:00
sched/walt/halt: prevent migration of migration_disabled tasks
Prior to the introduction of the PREEMPT_RT, migrate_disable() was introduced to support PREEMPT_RT. Many places throughout the code avoid using migrate_disable() if PREEMPT_RT is not set. However, bpf related code makes no such precautions, which is enabled. migrate_tasks() will forcefully migrate tasks off of this cpu without regard for migration_disabled state of the task. This causes a warning when attempting to migrate a migration_disabled task, and may have other unforseen consequences. Prevent migrate_tasks from moving tasks for which migration is disabled. Change-Id: I04aef81611c8d4df8e2abbd7833b8b12ec146548 Signed-off-by: Stephen Dickey <quic_dickey@quicinc.com>
This commit is contained in:
parent
8ecbc9e106
commit
31f357a500
|
|
@ -150,7 +150,7 @@ static void migrate_tasks(struct rq *dead_rq, struct rq_flags *rf)
|
|||
/* Find suitable destination for @next */
|
||||
dest_cpu = select_fallback_rq(dead_rq->cpu, next);
|
||||
|
||||
if (cpu_of(rq) != dest_cpu) {
|
||||
if (cpu_of(rq) != dest_cpu && !is_migration_disabled(next)) {
|
||||
/* only perform a required migration */
|
||||
rq = __migrate_task(rq, rf, next, dest_cpu);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user