public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/3] sched/topology: optimize topology_span_sane()
@ 2024-09-02 18:36 Yury Norov
  2024-09-02 18:36 ` [PATCH v3 1/3] sched/topology: pre-compute topology_span_sane() loop params Yury Norov
                   ` (4 more replies)
  0 siblings, 5 replies; 11+ messages in thread
From: Yury Norov @ 2024-09-02 18:36 UTC (permalink / raw)
  To: linux-kernel, Christophe JAILLET
  Cc: Yury Norov, Chen Yu, Leonardo Bras, Ingo Molnar, Peter Zijlstra,
	Juri Lelli, Vincent Guittot, Dietmar Eggemann, Steven Rostedt,
	Ben Segall, Mel Gorman, Valentin Schneider

The function may call cpumask_equal with tl->mask(cpu) == tl->mask(i),
even when cpu != i. In such case, cpumask_equal() would always return
true, and we can proceed to the next iteration immediately.

Valentin Schneider shares on it:

  PKG can potentially hit that condition, and so can any
  sched_domain_mask_f that relies on the node masks...

  I'm thinking ideally we should have checks in place to
  ensure all node_to_cpumask_map[] masks are disjoint,
  then we could entirely skip the levels that use these
  masks in topology_span_sane(), but there's unfortunately
  no nice way to flag them... Also there would be cases
  where there's no real difference between PKG and NODE
  other than NODE is still based on a per-cpu cpumask and
  PKG isn't, so I don't see a nicer way to go about this.

v1: https://lore.kernel.org/lkml/ZrJk00cmVaUIAr4G@yury-ThinkPad/T/
v2: https://lkml.org/lkml/2024/8/7/1299
v3:
 - add topology_cpumask_equal() helper in #3;
 - re-use 'cpu' as an iterator int the for_each_cpu() loop;
 - add proper versioning for all patches.

Yury Norov (3):
  sched/topology: pre-compute topology_span_sane() loop params
  sched/topology: optimize topology_span_sane()
  sched/topology: reorganize topology_span_sane() checking order

 kernel/sched/topology.c | 29 +++++++++++++++++++++++++----
 1 file changed, 25 insertions(+), 4 deletions(-)

-- 
2.43.0


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

end of thread, other threads:[~2024-11-07 15:22 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-02 18:36 [PATCH v3 0/3] sched/topology: optimize topology_span_sane() Yury Norov
2024-09-02 18:36 ` [PATCH v3 1/3] sched/topology: pre-compute topology_span_sane() loop params Yury Norov
2024-09-02 18:36 ` [PATCH v3 2/3] sched/topology: optimize topology_span_sane() Yury Norov
2024-09-02 18:36 ` [PATCH v3 3/3] sched/topology: reorganize topology_span_sane() checking order Yury Norov
2024-09-14 16:54 ` [PATCH v3 0/3] sched/topology: optimize topology_span_sane() Yury Norov
2024-09-30 19:14   ` Yury Norov
2024-11-06 16:28     ` Yury Norov
2024-11-06 17:58       ` Christophe JAILLET
2024-11-06 18:03         ` Yury Norov
2024-11-06 18:06 ` Peter Zijlstra
2024-11-07 15:22   ` Yury Norov

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