linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4 0/2] Improving topology_span_sane
@ 2025-03-04 16:08 Steve Wahl
  2025-03-04 16:08 ` [PATCH v4 1/2] sched/topology: improve topology_span_sane speed Steve Wahl
                   ` (4 more replies)
  0 siblings, 5 replies; 25+ messages in thread
From: Steve Wahl @ 2025-03-04 16:08 UTC (permalink / raw)
  To: Steve Wahl, Ingo Molnar, Peter Zijlstra, Juri Lelli,
	Vincent Guittot, Dietmar Eggemann, Steven Rostedt, Ben Segall,
	Mel Gorman, Valentin Schneider, linux-kernel, K Prateek Nayak,
	Vishal Chourasia, samir
  Cc: Naman Jain, Saurabh Singh Sengar, srivatsa, Michael Kelley,
	Russ Anderson, Dimitri Sivanich

toplogy_span_sane() has an O(N^2) algorithm that takes an inordinate
amount of time on systems with a large number of cpus.

The first patch in this series replaces the algorithm used with a O(N)
method that should exactly duplicate the previous code's results.

The second patch simplifies the first, taking a similar amount of time
to run, but potentially has different results than previous code under
situations believed to not truly exist, like a CPU not being included
in its own span.

Version 1:
  * Original patch

Version 2:

  * Adopted simplifications from K Prateek Nayak,and fixed use of
    num_possible_cpus().

Version 3:

  * Undid the simplifications from version 2 when noticed that results
    could differ from original code; kept num_possible_cpus() fix.

Version 4:

  * Turned the patch into a series of 2, the second re-introduces the
    simplifications, and includes further simplification suggested by
    Valentin Schneider in the discussion for Version 2.

Steve Wahl (2):
  sched/topology: improve topology_span_sane speed
  sched/topology: Refinement to topology_span_sane speedup

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

-- 
2.26.2


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

end of thread, other threads:[~2025-06-23  6:06 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-04 16:08 [PATCH v4 0/2] Improving topology_span_sane Steve Wahl
2025-03-04 16:08 ` [PATCH v4 1/2] sched/topology: improve topology_span_sane speed Steve Wahl
2025-04-08 19:05   ` [tip: sched/core] " tip-bot2 for Steve Wahl
2025-06-10 11:07   ` [PATCH v4 1/2] " Leon Romanovsky
2025-06-10 11:33     ` K Prateek Nayak
2025-06-10 12:36       ` Leon Romanovsky
2025-06-10 13:09         ` Leon Romanovsky
2025-06-10 19:39           ` Steve Wahl
2025-06-11  6:06             ` Leon Romanovsky
2025-06-11  6:56               ` K Prateek Nayak
2025-06-12  7:41                 ` Leon Romanovsky
2025-06-12  9:30                   ` K Prateek Nayak
2025-06-12 10:41                     ` K Prateek Nayak
2025-06-15  6:42                       ` Leon Romanovsky
2025-06-16 14:18                         ` Steve Wahl
2025-06-17  3:04                           ` K Prateek Nayak
2025-06-17  7:55                             ` Leon Romanovsky
2025-06-17  7:34                           ` Leon Romanovsky
2025-06-17  9:22                             ` K Prateek Nayak
2025-06-23  6:06                               ` K Prateek Nayak
2025-03-04 16:08 ` [PATCH v4 2/2] sched/topology: Refinement to topology_span_sane speedup Steve Wahl
2025-04-08 19:05   ` [tip: sched/core] " tip-bot2 for Steve Wahl
2025-03-06  6:46 ` [PATCH v4 0/2] Improving topology_span_sane K Prateek Nayak
2025-03-06 14:33 ` Valentin Schneider
2025-03-07 10:06 ` Madadi Vineeth Reddy

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).