mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] Fix imbalance issue when balancing fork
@ 2025-07-01  2:45 Adam Li
  2025-07-01  2:45 ` [PATCH 1/2] sched/fair: Only update stats for allowed CPUs when looking for dst group Adam Li
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Adam Li @ 2025-07-01  2:45 UTC (permalink / raw)
  To: mingo, peterz, juri.lelli, vincent.guittot
  Cc: dietmar.eggemann, rostedt, bsegall, mgorman, vschneid, cl,
	linux-kernel, patches, Adam Li

Load imbalance is observed when the workload frequently forks new threads.
Due to CPU affinity, the workload can run on CPU 0-7 in the first
group, and only on CPU 8-11 in the second group. CPU 12-15 are always idle.

{ 0 1 2 3 4 5 6 7 } {8 9 10 11 12 13 14 15}
  * * * * * * * *    * * *  *

When looking for dst group for newly forked threads, in many times
update_sg_wakeup_stats() reports the second group has more idle CPUs
than the first group. The scheduler thinks the second group is less
busy. Then it selects least busy CPUs among CPU 8-11. So CPU 8-11 can be
crowded with newly forked threads, at the same time CPU 0-7 can be idle.

The first patch 'Only update stats of allowed CPUs when looking for dst
group' *alone* can fix this imbalance issue.

And I think the second patch also makes sense in this scenario. If group
weight includes CPUs a task cannot use, group classification can be
incorrect. Please comment.

Adam Li (2):
  sched/fair: Only update stats of allowed CPUs when looking for dst
    group
  sched/fair: Only count group weight for allowed CPUs when looking for
    dst group

 kernel/sched/fair.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: [PATCH 0/2] Fix imbalance issue when balancing fork
@ 2025-07-15 19:14 Shubhang Kaushik Prasanna Kumar
  0 siblings, 0 replies; 6+ messages in thread
From: Shubhang Kaushik Prasanna Kumar @ 2025-07-15 19:14 UTC (permalink / raw)
  To: Adam Li OS
  Cc: bsegall, cl, dietmar.eggemann, juri.lelli, linux-kernel, mgorman,
	mingo, Open Source Submission, peterz, rostedt, vincent.guittot,
	vschneid

This patch-set tackles a significant task placement imbalance encountered under restricted CPU affinity, particularly on Ampere Altra systems. Our performance tests reveal that the first patch demonstrably improves task placement by 20-30% in scenarios where the number of threads increasingly outnumbers the available cores. However, the second patch unexpectedly introduces regressions when tested against higher thread count scenarios, requiring further investigation.

In light of these findings and the potential regression, the following questions arise:
 Q. Has the regression been investigated to determine if it is specific to two-level scheduling domains or manifests more broadly?
 Q. Were function-level latencies profiled to pinpoint the exact source of the regression within the code path introduced by the second patch?
 Q. How do these patches influence performance and task placement on systems with linear topologies, and do they exhibit more consistent behavior in those configurations?

- Shubhang

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-07-15 19:14 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-07-01  2:45 [PATCH 0/2] Fix imbalance issue when balancing fork Adam Li
2025-07-01  2:45 ` [PATCH 1/2] sched/fair: Only update stats for allowed CPUs when looking for dst group Adam Li
2025-07-01  2:45 ` [PATCH 2/2] sched/fair: Only count group weight " Adam Li
2025-07-04  9:17 ` [PATCH 0/2] Fix imbalance issue when balancing fork Peter Zijlstra
2025-07-08 13:27   ` Adam Li
2025-07-15 19:14 Shubhang Kaushik Prasanna Kumar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®