summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorJemmy Wong <jemmywong512@gmail.com>2026-10-13 16:43:38 +0800
committerPeter Zijlstra <peterz@infradead.org>2026-10-16 09:49:04 +0200
commitfcceb7da94659695d6cba97190e18e87d9cce82c (patch)
tree00242570f0a8cc62834f3a26c7f8c93085d6afa7 /tools/perf/scripts/python
parent96a494c9cfd8f4bb7b1a7a70275426db71cf98aa (diff)
downloadlinux-fcceb7da94659695d6cba97190e18e87d9cce82c.tar.gz
linux-fcceb7da94659695d6cba97190e18e87d9cce82c.zip
sched/cache: Avoid publishing partial LLC utilization
update_sg_lb_stats() sums utilization over the CPUs in both sched_group_span(group) and env->cpus, but takes capacity from group->sgc->capacity for the whole group. record_sg_llc_stats() publishes both. Rejecting an all-affinity-pinned source runqueue removes that CPU from env->cpus and retries group selection. The retry can publish the partial utilization with the full capacity. can_migrate_llc() then treats a busy preferred LLC as having spare capacity. More tasks can aggregate into it, migrations out can be blocked, and two busy LLCs may not fall back to generic balancing. This increases CPU contention and task latency. Found by inspection. Skip publication on affinity retries using LBF_ALL_PINNED, retaining the first-pass snapshots and avoiding repeated cpumask checks. On the first pass, publish either shared LLC statistic only when env->cpus covers the whole group. Load balancing still uses the affinity-filtered statistics. The same window exists during CPU hotplug. env->cpus drops a CPU at set_cpu_active(false), but the group span and sgc->capacity still include it until cpuset_cpu_inactive() rebuilds the domains. Keeping the previous snapshot avoids the mismatched publish. After the rebuild, the next periodic balance records both statistics again. Fixes: f025ef275388 ("sched/cache: Record per LLC utilization to guide cache aware scheduling decisions") Suggested-by: K Prateek Nayak <kprateek.nayak@amd.com> Suggested-by: Tim Chen <tim.c.chen@linux.intel.com> Signed-off-by: Jemmy Wong <jemmywong512@gmail.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://patch.msgid.link/20261013084338.55100-1-jemmywong512@gmail.com
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions