linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 00/12] sched: Avoid unnecessary migrations within SMT domains
@ 2023-04-06 20:31 Ricardo Neri
  2023-04-06 20:31 ` [PATCH v4 01/12] sched/fair: Move is_core_idle() out of CONFIG_NUMA Ricardo Neri
                   ` (12 more replies)
  0 siblings, 13 replies; 34+ messages in thread
From: Ricardo Neri @ 2023-04-06 20:31 UTC (permalink / raw)
  To: Peter Zijlstra (Intel), Juri Lelli, Vincent Guittot
  Cc: Ricardo Neri, Ravi V. Shankar, Ben Segall,
	Daniel Bristot de Oliveira, Dietmar Eggemann, Len Brown,
	Mel Gorman, Rafael J. Wysocki, Srinivas Pandruvada,
	Steven Rostedt, Tim Chen, Valentin Schneider, Ionela Voinescu,
	x86, linux-kernel, Ricardo Neri

Hi,

This is v4 of this series. Previous versions can be found here [1], [2],
and here [3]. To avoid duplication, I do not include the cover letter of
the original submission. You can read it in [1].

This patchset applies cleanly on today's master branch of the tip tree.

Changes since v3:

Nobody liked the proposed changes to the setting of prefer_sibling.
Instead, I tweaked the solution that Dietmar proposed. Now the busiest
group, not the local group, determines the setting of prefer_sibling.

Vincent suggested improvements to the logic to decide whether to follow
asym_packing priorities. Peter suggested to wrap that in a helper function.
I added sched_use_asym_prio().

Ionela found that removing SD_ASYM_PACKING from the SMT domain in x86
rendered sd_asym_packing NULL in SMT cores. Now highest_flag_domain()
does not assume that all child domains have the requested flag.

Tim found that asym_active_balance() needs to also check for the idle
states of the SMT siblings of lb_env::dst_cpu. I added such check.

I wrongly assumed that asym_packing could only be used when the busiest
group had exactly one busy CPU. This broke asym_packing balancing at the
DIE domain. I limited this check to balances between cores at the MC
level.

As per suggestion from Dietmar, I removed sched_asym_smt_can_pull_tasks()
and placed its logic in sched_asym(). Also, sched_asym() uses
sched_smt_active() to skip checks when not needed.

I also added a patch from Chen Yu to enable asym_packing balancing in
Meteor Lake, which has CPUs of different maximum frequency in more than
one die.

Hopefully, these patches are in sufficiently good shape to be merged?

Thank you for your feedback and I look forward to getting more of it!

New patches: 8, 12
Updated patches: 2, 3, 4, 6, 7
Unchanged patches: 1, 5, 9, 10, 11

BR,
Ricardo

[1]. https://lore.kernel.org/lkml/20220825225529.26465-1-ricardo.neri-calderon@linux.intel.com/
[2]. https://lore.kernel.org/lkml/20221122203532.15013-1-ricardo.neri-calderon@linux.intel.com/
[3]. https://lore.kernel.org/lkml/20230207045838.11243-1-ricardo.neri-calderon@linux.intel.com/

Chen Yu (1):
  x86/sched: Add the SD_ASYM_PACKING flag to the die domain of hybrid
    processors

Ricardo Neri (11):
  sched/fair: Move is_core_idle() out of CONFIG_NUMA
  sched/fair: Only do asym_packing load balancing from fully idle SMT
    cores
  sched/fair: Simplify asym_packing logic for SMT cores
  sched/fair: Let low-priority cores help high-priority busy SMT cores
  sched/fair: Keep a fully_busy SMT sched group as busiest
  sched/fair: Use the busiest group to set prefer_sibling
  sched/fair: Do not even the number of busy CPUs via asym_packing
  sched/topology: Check SDF_SHARED_CHILD in highest_flag_domain()
  sched/topology: Remove SHARED_CHILD from ASYM_PACKING
  x86/sched: Remove SD_ASYM_PACKING from the SMT domain flags
  x86/sched/itmt: Give all SMT siblings of a core the same priority

 arch/x86/kernel/itmt.c         |  23 +---
 arch/x86/kernel/smpboot.c      |   4 +-
 include/linux/sched/sd_flags.h |   5 +-
 kernel/sched/fair.c            | 216 +++++++++++++++++----------------
 kernel/sched/sched.h           |  22 +++-
 5 files changed, 138 insertions(+), 132 deletions(-)

-- 
2.25.1


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

end of thread, other threads:[~2023-05-22  7:58 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-06 20:31 [PATCH v4 00/12] sched: Avoid unnecessary migrations within SMT domains Ricardo Neri
2023-04-06 20:31 ` [PATCH v4 01/12] sched/fair: Move is_core_idle() out of CONFIG_NUMA Ricardo Neri
2023-05-10 13:49   ` [tip: sched/core] " tip-bot2 for Ricardo Neri
2023-04-06 20:31 ` [PATCH v4 02/12] sched/fair: Only do asym_packing load balancing from fully idle SMT cores Ricardo Neri
2023-05-10 13:49   ` [tip: sched/core] " tip-bot2 for Ricardo Neri
2023-04-06 20:31 ` [PATCH v4 03/12] sched/fair: Simplify asym_packing logic for " Ricardo Neri
2023-05-10 13:49   ` [tip: sched/core] " tip-bot2 for Ricardo Neri
2023-04-06 20:31 ` [PATCH v4 04/12] sched/fair: Let low-priority cores help high-priority busy " Ricardo Neri
2023-05-10 13:49   ` [tip: sched/core] " tip-bot2 for Ricardo Neri
2023-04-06 20:31 ` [PATCH v4 05/12] sched/fair: Keep a fully_busy SMT sched group as busiest Ricardo Neri
2023-05-10 13:49   ` [tip: sched/core] " tip-bot2 for Ricardo Neri
2023-05-12 18:41   ` [PATCH v4 05/12] " Shrikanth Hegde
2023-05-19  0:01     ` Ricardo Neri
2023-04-06 20:31 ` [PATCH v4 06/12] sched/fair: Use the busiest group to set prefer_sibling Ricardo Neri
2023-05-10 13:49   ` [tip: sched/core] " tip-bot2 for Ricardo Neri
2023-04-06 20:31 ` [PATCH v4 07/12] sched/fair: Do not even the number of busy CPUs via asym_packing Ricardo Neri
2023-05-10 13:49   ` [tip: sched/core] " tip-bot2 for Ricardo Neri
2023-04-06 20:31 ` [PATCH v4 08/12] sched/topology: Check SDF_SHARED_CHILD in highest_flag_domain() Ricardo Neri
2023-05-10 13:49   ` [tip: sched/core] " tip-bot2 for Ricardo Neri
2023-04-06 20:31 ` [PATCH v4 09/12] sched/topology: Remove SHARED_CHILD from ASYM_PACKING Ricardo Neri
2023-05-10 13:49   ` [tip: sched/core] " tip-bot2 for Ricardo Neri
2023-04-06 20:31 ` [PATCH v4 10/12] x86/sched: Remove SD_ASYM_PACKING from the SMT domain flags Ricardo Neri
2023-05-10 13:49   ` [tip: sched/core] " tip-bot2 for Ricardo Neri
2023-04-06 20:31 ` [PATCH v4 11/12] x86/sched/itmt: Give all SMT siblings of a core the same priority Ricardo Neri
2023-05-10 13:49   ` [tip: sched/core] " tip-bot2 for Ricardo Neri
2023-04-06 20:31 ` [PATCH v4 12/12] x86/sched: Add the SD_ASYM_PACKING flag to the die domain of hybrid processors Ricardo Neri
2023-05-10 13:49   ` [tip: sched/core] " tip-bot2 for Chen Yu
2023-04-29 15:32 ` [PATCH v4 00/12] sched: Avoid unnecessary migrations within SMT domains Peter Zijlstra
2023-05-01 18:30   ` Tim Chen
2023-05-02  1:42   ` Ricardo Neri
2023-05-02  1:52     ` Steven Rostedt
2023-05-12 18:23   ` Shrikanth Hegde
2023-05-19  0:03     ` Ricardo Neri
2023-05-22  7:55       ` Shrikanth Hegde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).