Skip to content

sched/balancing: Standardize the naming of scheduler load-balancing functions

Ingo Molnar lkml 1 version Applied

Status from this message: The following commit has been merged into the sched/core branch of tip:

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest13 patches 7 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/13sched/balancing: Rename run_rebalance_domains() => sched_balance_softirq()Documentation/scheduler/sched-domains.rst Documentation/translations/zh_CN/scheduler/sched-domains.rst kernel/sched/fair.c+4 -40 replies
2/13sched/balancing: Rename scheduler_tick() => sched_tick()Documentation/scheduler/sched-domains.rst Documentation/translations/zh_CN/scheduler/sched-domains.rst include/linux/sched.h +5 more+11 -110 replies
3/13sched/balancing: Rename trigger_load_balance() => sched_balance_trigger()Documentation/scheduler/sched-domains.rst Documentation/translations/zh_CN/scheduler/sched-domains.rst kernel/sched/core.c +2 more+5 -50 replies
4/13sched/balancing: Rename rebalance_domains() => sched_balance_domains()Documentation/scheduler/sched-domains.rst Documentation/translations/zh_CN/scheduler/sched-domains.rst arch/arm/kernel/topology.c +2 more+8 -80 replies
5/13sched/balancing: Rename load_balance() => sched_balance_rq()Documentation/scheduler/sched-domains.rst Documentation/scheduler/sched-stats.rst Documentation/translations/zh_CN/scheduler/sched-domains.rst +3 more+41 -412 replies
6/13sched/balancing: Rename find_busiest_queue() => find_src_rq()kernel/sched/fair.c+3 -30 replies
7/13sched/balancing: Rename find_src_rq() => sched_balance_find_src_rq()kernel/sched/fair.c+3 -32 replies
8/13sched/balancing: Rename find_busiest_group() => sched_balance_find_src_group()kernel/sched/fair.c+7 -70 replies
9/13sched/balancing: Rename update_blocked_averages() => sched_balance_update_blocked_averages()kernel/sched/fair.c kernel/sched/pelt.c+5 -52 replies
10/13sched/balancing: Rename newidle_balance() => sched_balance_newidle()kernel/sched/fair.c+8 -80 replies
11/13sched/balancing: Rename find_idlest_group_cpu() => sched_balance_find_dst_group_cpu()kernel/sched/fair.c+3 -30 replies
12/13sched/balancing: Rename find_idlest_group() => sched_balance_find_dst_group()kernel/sched/fair.c+4 -40 replies
13/13sched/balancing: Rename find_idlest_cpu() => sched_balance_find_dst_cpu()kernel/sched/fair.c+3 -30 replies

Reviews trailers per patch

3 of 13 patches have a Reviewed-by or Acked-by.

PatchValentin SchneiderShrikanth Hegde
1/13R-b
2/13A-b
3/13
4/13
5/13R-b
6/13
7/13
8/13
9/13
10/13
11/13
12/13
13/13

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH -v1 00/13] sched/balancing: Standardize the naming of scheduler load-balancing functions

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(-)
Signature · 1 line
2.40.1