linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: linux-kernel@vger.kernel.org
Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Shrikanth Hegde <sshegde@linux.ibm.com>,
	Valentin Schneider <vschneid@redhat.com>,
	Vincent Guittot <vincent.guittot@linaro.org>
Subject: [PATCH -v1 00/13] sched/balancing: Standardize the naming of scheduler load-balancing functions
Date: Fri,  8 Mar 2024 12:18:06 +0100	[thread overview]
Message-ID: <20240308111819.1101550-1-mingo@kernel.org> (raw)

Over the years we've grown a colorful zoo of scheduler
load-balancing function names - both following random,
idiosyncratic patterns, and gaining historic misnomers
that are not accurate anymore.

We have 'newidle_balance()' to rebalance newly idle tasks,
but 'balance_domains()' to rebalance domains. We have
a find_idlest_cpu() function whose purpose is not to find
the idlest CPU anymore, and a find_busiest_queue() function
whose purpose is not to find the busiest runqueue anymore.

Fix most of the misnomers and organize the functions along the
sched_balance_*() namespace:

  scheduler_tick()		=> sched_tick()
  run_rebalance_domains()	=> sched_balance_softirq()
  trigger_load_balance()	=> sched_balance_trigger()
  rebalance_domains()		=> sched_balance_domains()
  load_balance()		=> sched_balance_rq()
  newidle_balance()		=> sched_balance_newidle()
  find_busiest_queue()		=> sched_balance_find_src_rq()
  find_busiest_group()		=> sched_balance_find_src_group()
  find_idlest_group_cpu()	=> sched_balance_find_dst_group_cpu()
  find_idlest_group()		=> sched_balance_find_dst_group()
  find_idlest_cpu()		=> sched_balance_find_dst_cpu()
  update_blocked_averages()	=> sched_balance_update_blocked_averages()

I think the visual improvement of left vs. right column
demonstrates the goal nicely.

While the function names got a bit longer, another advantage of
the common prefix, beyond readability, is that now a:

  git grep sched_balance_

... will show most of the balancing code nicely.

( I have a few more patches that standardize the NOHZ balancing
  code along the nohz_balance_*() nomenclature as well. )

Thanks,

    Ingo

==================>
Ingo Molnar (13):
  sched/balancing: Rename run_rebalance_domains() => sched_balance_softirq()
  sched/balancing: Rename scheduler_tick() => sched_tick()
  sched/balancing: Rename trigger_load_balance() => sched_balance_trigger()
  sched/balancing: Rename rebalance_domains() => sched_balance_domains()
  sched/balancing: Rename load_balance() => sched_balance_rq()
  sched/balancing: Rename find_busiest_queue() => find_src_rq()
  sched/balancing: Rename find_src_rq() => sched_balance_find_src_rq()
  sched/balancing: Rename find_busiest_group() => sched_balance_find_src_group()
  sched/balancing: Rename update_blocked_averages() => sched_balance_update_blocked_averages()
  sched/balancing: Rename newidle_balance() => sched_balance_newidle()
  sched/balancing: Rename find_idlest_group_cpu() => sched_balance_find_dst_group_cpu()
  sched/balancing: Rename find_idlest_group() => sched_balance_find_dst_group()
  sched/balancing: Rename find_idlest_cpu() => sched_balance_find_dst_cpu()

 Documentation/scheduler/sched-domains.rst                       | 12 ++--
 Documentation/scheduler/sched-stats.rst                         | 32 +++++------
 Documentation/translations/zh_CN/scheduler/sched-domains.rst    | 10 ++--
 Documentation/translations/zh_CN/scheduler/sched-stats.rst      | 30 +++++-----
 arch/arm/kernel/topology.c                                      |  2 +-
 include/linux/sched.h                                           |  2 +-
 include/linux/sched/topology.h                                  |  2 +-
 kernel/sched/core.c                                             |  6 +-
 kernel/sched/fair.c                                             | 88 ++++++++++++++---------------
 kernel/sched/loadavg.c                                          |  2 +-
 kernel/sched/pelt.c                                             |  2 +-
 kernel/sched/sched.h                                            |  4 +-
 kernel/time/timer.c                                             |  2 +-
 kernel/workqueue.c                                              |  2 +-
 .../selftests/ftrace/test.d/ftrace/func_set_ftrace_file.tc      |  2 +-
 15 files changed, 99 insertions(+), 99 deletions(-)

-- 
2.40.1


             reply	other threads:[~2024-03-08 11:18 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-08 11:18 Ingo Molnar [this message]
2024-03-08 11:18 ` [PATCH 01/13] sched/balancing: Rename run_rebalance_domains() => sched_balance_softirq() Ingo Molnar
2024-03-12 12:00   ` [tip: sched/core] " tip-bot2 for Ingo Molnar
2024-03-08 11:18 ` [PATCH 02/13] sched/balancing: Rename scheduler_tick() => sched_tick() Ingo Molnar
2024-03-12 12:00   ` [tip: sched/core] " tip-bot2 for Ingo Molnar
2024-03-08 11:18 ` [PATCH 03/13] sched/balancing: Rename trigger_load_balance() => sched_balance_trigger() Ingo Molnar
2024-03-12 12:00   ` [tip: sched/core] " tip-bot2 for Ingo Molnar
2024-03-08 11:18 ` [PATCH 04/13] sched/balancing: Rename rebalance_domains() => sched_balance_domains() Ingo Molnar
2024-03-12 12:00   ` [tip: sched/core] " tip-bot2 for Ingo Molnar
2024-03-08 11:18 ` [PATCH 05/13] sched/balancing: Rename load_balance() => sched_balance_rq() Ingo Molnar
2024-03-11  8:17   ` Shrikanth Hegde
2024-03-12 10:27     ` Ingo Molnar
2024-03-12 12:00   ` [tip: sched/core] " tip-bot2 for Ingo Molnar
2024-03-08 11:18 ` [PATCH 06/13] sched/balancing: Rename find_busiest_queue() => find_src_rq() Ingo Molnar
2024-03-12 12:00   ` [tip: sched/core] sched/balancing: Rename find_busiest_queue() => sched_balance_find_src_rq() tip-bot2 for Ingo Molnar
2024-03-08 11:18 ` [PATCH 07/13] sched/balancing: Rename find_src_rq() " Ingo Molnar
2024-03-08 13:51   ` Vincent Guittot
2024-03-08 17:49     ` Ingo Molnar
2024-03-08 11:18 ` [PATCH 08/13] sched/balancing: Rename find_busiest_group() => sched_balance_find_src_group() Ingo Molnar
2024-03-12 12:00   ` [tip: sched/core] " tip-bot2 for Ingo Molnar
2024-03-08 11:18 ` [PATCH 09/13] sched/balancing: Rename update_blocked_averages() => sched_balance_update_blocked_averages() Ingo Molnar
2024-03-11  6:42   ` Honglei Wang
2024-03-12 10:36     ` Ingo Molnar
2024-03-12 12:00   ` [tip: sched/core] " tip-bot2 for Ingo Molnar
2024-03-08 11:18 ` [PATCH 10/13] sched/balancing: Rename newidle_balance() => sched_balance_newidle() Ingo Molnar
2024-03-12 12:00   ` [tip: sched/core] " tip-bot2 for Ingo Molnar
2024-03-08 11:18 ` [PATCH 11/13] sched/balancing: Rename find_idlest_group_cpu() => sched_balance_find_dst_group_cpu() Ingo Molnar
2024-03-12 12:00   ` [tip: sched/core] " tip-bot2 for Ingo Molnar
2024-03-08 11:18 ` [PATCH 12/13] sched/balancing: Rename find_idlest_group() => sched_balance_find_dst_group() Ingo Molnar
2024-03-12 12:00   ` [tip: sched/core] " tip-bot2 for Ingo Molnar
2024-03-08 11:18 ` [PATCH 13/13] sched/balancing: Rename find_idlest_cpu() => sched_balance_find_dst_cpu() Ingo Molnar
2024-03-12 12:00   ` [tip: sched/core] " tip-bot2 for Ingo Molnar
2024-03-08 11:25 ` [PATCH -v1 00/13] sched/balancing: Standardize the naming of scheduler load-balancing functions Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240308111819.1101550-1-mingo@kernel.org \
    --to=mingo@kernel.org \
    --cc=dietmar.eggemann@arm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=sshegde@linux.ibm.com \
    --cc=torvalds@linux-foundation.org \
    --cc=vincent.guittot@linaro.org \
    --cc=vschneid@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).