Re: [PATCH 01/12] sched/core: Avoid false migration warning for proxy donors
[email protected] Tue, 21 Jul 2026 06:50:24 +0000
| Newsgroups | dev.linux.lists.sched-ext |
|---|---|
| Message-ID | <[email protected]> |
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: - [Medium] The warning for migrating a migration-disabled task is incorrectly suppressed for all sleeping tasks when proxy execution is enabled, instead of just for blocked proxy donors. -- --- Patch [1]: [PATCH 01/12] sched/core: Avoid false migration warning for proxy donors --- commit 3b0fd432ea71e1ba27a8e56bb387fb372b053daf Author: Andrea Righi <[email protected]> sched/core: Avoid false migration warning for proxy donors This commit updates set_task_cpu to suppress a false positive warning when migrating a proxy donor. It allows moving a blocked scheduling context to another CPU even when the donor task has migration disabled. > diff --git a/kernel/sched/core.c b/kernel/sched/core.c > --- a/kernel/sched/core.c > +++ b/kernel/sched/core.c [ ... ] > @@ -3376,7 +3376,13 @@ void set_task_cpu(struct task_struct *p, unsigned int new_cpu) > */ > WARN_ON_ONCE(!cpu_online(new_cpu)); > > - WARN_ON_ONCE(is_migration_disabled(p)); > + /* > + * Proxy execution can move a blocked task's scheduling context to any > + * CPU without moving its migration-disabled execution context. The > + * wakeup path will return the task to a CPU where it can execute. > + */ > + WARN_ON_ONCE(is_migration_disabled(p) && > + !(sched_proxy_exec() && p->is_blocked)); [Severity: Medium] Does this logic inadvertently suppress the warning for all sleeping tasks rather than just proxy donors? Because p->is_blocked is set unconditionally for all sleeping tasks when __schedule calls try_to_block_task, this condition in set_task_cpu appears to suppress the warning for any migration-disabled sleeping task whenever proxy execution is globally enabled. If another scheduler component, such as a load balancer or a BPF sched_ext extension, incorrectly migrates a normal sleeping task that has migration disabled, this overly broad check might hide the invalid migration and mask further issues. > > trace_sched_migrate_task(p, new_cpu); -- Sashiko AI review ยท https://sashiko.dev/#/patchset/[email protected]?part=1