summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorLu Wang <wanglu.priv@gmail.com>2026-09-21 17:37:23 -0700
committerIngo Molnar <mingo@kernel.org>2026-09-22 10:50:29 +0200
commitd6013e2465d98d524b030a81c1223882a1bb7e4c (patch)
treee96b425770371c0c1b9136a30135bca9609e00c5 /include
parent0d6526f82c3cdefcca47f73f5fc08dc6f335eac6 (diff)
downloadlinux-stable-d6013e2465d98d524b030a81c1223882a1bb7e4c.tar.gz
linux-stable-d6013e2465d98d524b030a81c1223882a1bb7e4c.zip
sched/cache: Honor migrate_llc_task semantics in active load balance, to fix LLC mis-scheduling bug
Cache aware scheduling introduced the migrate_llc_task migration type to direct tasks toward their preferred LLC, but its semantics can be lost when passive load balance falls back to active load balance (ALB). This may allow ALB to select a candidate whose preferred LLC does not match the destination, moving it away from its preferred LLC. Example scenario: src_rq has two runnable tasks, p1 and p2. p1 prefers dst_rq (dst_llc), while p2 prefers src_rq (src_llc). In this case, migrate_llc_task is set because src_rq has at least one task, p1, that wants to migrate to dst_rq. In ALB, can_migrate_task() finds p2 and returns true for it, thus moving p2 out of its preferred LLC. Solution: The CPU stopper in ALB constructs a fresh lb_env that does not inherit migration_type from the passive load-balance pass. Two approaches are possible: (a) Add a new member to struct rq so ALB can inherit migrate_llc_task from the passive LB that triggered it. (b) Define a new flag LBF_ACTIVE_LB_LLC and select the stopper callback at kick time to preserve the migration semantics across the asynchronous boundary. We choose (b) because it avoids passing migration_type through the stopper, which would affect the meaning of migration_type for delayed-dequeue tasks. Fixes: e4c9a4cb244a ("sched/cache: Add migrate_llc_task migration type for cache-aware balancing") Suggested-by: Chen Yu <yu.c.chen@intel.com> Signed-off-by: Lu Wang <wanglu.priv@gmail.com> Signed-off-by: Tim Chen <tim.c.chen@linux.intel.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Reviewed-by: Tim Chen <tim.c.chen@linux.intel.com> Reviewed-by: Chen Yu <yu.c.chen@intel.com> Cc: <stable@kernel.org> # v7.2.x Link: https://patch.msgid.link/cb39f64a17fc2b76097264aaec74a2d6dfff4315.1790035273.git.tim.c.chen@linux.intel.com
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions