Linux Trace Kernel
 help / color / mirror / Atom feed
* [PATCH 0/2] sched: Refine scheduler naming for clarity and specificity
@ 2025-02-19 18:20 Jemmy Wong
  2025-02-19 18:20 ` [PATCH 1/2] " Jemmy Wong
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Jemmy Wong @ 2025-02-19 18:20 UTC (permalink / raw)
  To: Steven Rostedt, Masami Hiramatsu, Mathieu Desnoyers, Mark Rutland,
	Jonathan Corbet, Ingo Molnar, Peter Zijlstra, Juri Lelli,
	Vincent Guittot, Dietmar Eggemann, Ben Segall, Mel Gorman,
	Valentin Schneider, linux-kernel, linux-trace-kernel, linux-doc
  Cc: Jemmy Wong

Hi, I'm relatively new to Linux and eager to contribute to the community
with some foundational work.

I aim to help improve code readability and maintainability.
While reading the scheduler code, I found some naming inconsistencies
that made understanding the code more difficult.

Specifically:
1. Some function names do not accurately reflect their purpose.
2. Certain names are too general, making it unclear what they represent.
3. Some concepts are ambiguous, leading to potential confusion.

- Rename ttwu_do_wakeup to ttwu_set_running:
    - This function only sets task state to TASK_RUNNING,
        not performing the actual wakeup.

- Rename update_cfs_group to update_cfs_group_shares:
    - The name was too generic; specifying "shares" clarifies its purpose.

- Rename place_entity to update_entity_sched:
    - The function does not handle entity placement but updates
        sched info: vruntime, slice, and deadline.

- Rename update_load_<set, add, sub> to load_weight_<set, add, sub>:
    - "load" can refer to either PELT load or load weight, causing ambiguity;
        "load_weight" specifies it's dealing with weight.

- Rename struct sched_avg to struct sched_pelt:
    - This structure includes not just average statistics
        but also sums like <load, runnable, util>_sum, last_updae_time,
        all of which are PELT (Per-Entity Load Tracking) metrics.

- Rename init_entity_runnable_average to init_entity_pelt

This patch aims to improve code readability and reduce confusion by
ensuring names are more descriptive of their actual functionality or purpose.

Signed-off-by: Jemmy Wong <Jemmywong512@gmail.com>
---
Jemmy Wong (2):
  sched: Refine scheduler naming for clarity and specificity
  sched: Refine sched_avg naming for clarity and specificity

 Documentation/trace/ftrace.rst | 190 ++++++-------
 include/linux/sched.h          |   6 +-
 kernel/sched/core.c            |  18 +-
 kernel/sched/debug.c           |  36 +--
 kernel/sched/fair.c            | 478 ++++++++++++++++-----------------
 kernel/sched/pelt.c            | 100 +++----
 kernel/sched/pelt.h            |  16 +-
 kernel/sched/rt.c              |   2 +-
 kernel/sched/sched.h           |  22 +-
 9 files changed, 433 insertions(+), 435 deletions(-)

--
2.43.0

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

end of thread, other threads:[~2025-02-20  6:49 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-19 18:20 [PATCH 0/2] sched: Refine scheduler naming for clarity and specificity Jemmy Wong
2025-02-19 18:20 ` [PATCH 1/2] " Jemmy Wong
2025-02-19 18:42   ` Steven Rostedt
2025-02-19 19:04     ` Jemmy Wong
2025-02-19 19:10       ` Steven Rostedt
2025-02-19 18:20 ` [PATCH 2/2] sched: Refine sched_avg " Jemmy Wong
2025-02-19 22:24 ` [PATCH 0/2] sched: Refine scheduler " Steven Rostedt
2025-02-20  6:48   ` Jemmy Wong

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