* [PATCH 0/2] sched/fair: cleanups and readability fixes
@ 2025-12-19 8:50 Zhan Xusheng
2025-12-19 8:50 ` [PATCH 1/2] sched/fair: fix comma operator misuse in NUMA fault accounting Zhan Xusheng
2025-12-19 8:50 ` [PATCH 2/2] sched/fair: replace bare 'unsigned' with 'unsigned int' Zhan Xusheng
0 siblings, 2 replies; 4+ messages in thread
From: Zhan Xusheng @ 2025-12-19 8:50 UTC (permalink / raw)
To: Peter Zijlstra; +Cc: Ingo Molnar, linux-sched, linux-kernel, Zhan Xusheng
This series contains two small cleanups in the CFS scheduler:
1. Fix misuse of the comma operator in NUMA fault accounting by
replacing it with explicit statements, improving readability.
2. Replace bare 'unsigned' casts with explicit 'unsigned int' casts
to comply with kernel coding style.
No functional changes intended.
Thanks,
Zhan Xusheng
--
2.43.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] sched/fair: fix comma operator misuse in NUMA fault accounting
2025-12-19 8:50 [PATCH 0/2] sched/fair: cleanups and readability fixes Zhan Xusheng
@ 2025-12-19 8:50 ` Zhan Xusheng
2025-12-19 10:54 ` Peter Zijlstra
2025-12-19 8:50 ` [PATCH 2/2] sched/fair: replace bare 'unsigned' with 'unsigned int' Zhan Xusheng
1 sibling, 1 reply; 4+ messages in thread
From: Zhan Xusheng @ 2025-12-19 8:50 UTC (permalink / raw)
To: Peter Zijlstra; +Cc: Ingo Molnar, linux-sched, linux-kernel, Zhan Xusheng
Replace the comma operator with separate statements when assigning
NUMA fault statistics. This improves readability and follows kernel
coding style.
Signed-off-by: Zhan Xusheng <zhanxusheng@xiaomi.com>
---
kernel/sched/fair.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index da46c3164537..56dd655d9bc2 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -13957,7 +13957,7 @@ void show_numa_stats(struct task_struct *p, struct seq_file *m)
tpf = p->numa_faults[task_faults_idx(NUMA_MEM, node, 1)];
}
if (ng) {
- gsf = ng->faults[task_faults_idx(NUMA_MEM, node, 0)],
+ gsf = ng->faults[task_faults_idx(NUMA_MEM, node, 0)];
gpf = ng->faults[task_faults_idx(NUMA_MEM, node, 1)];
}
print_numa_stats(m, node, tsf, tpf, gsf, gpf);
--
2.43.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 2/2] sched/fair: replace bare 'unsigned' with 'unsigned int'
2025-12-19 8:50 [PATCH 0/2] sched/fair: cleanups and readability fixes Zhan Xusheng
2025-12-19 8:50 ` [PATCH 1/2] sched/fair: fix comma operator misuse in NUMA fault accounting Zhan Xusheng
@ 2025-12-19 8:50 ` Zhan Xusheng
1 sibling, 0 replies; 4+ messages in thread
From: Zhan Xusheng @ 2025-12-19 8:50 UTC (permalink / raw)
To: Peter Zijlstra; +Cc: Ingo Molnar, linux-sched, linux-kernel, Zhan Xusheng
Replace 'unsigned' casts with explicit 'unsigned int'
casts to comply with kernel coding style.
No functional change intended.
Signed-off-by: Zhan Xusheng <zhanxusheng@xiaomi.com>
---
kernel/sched/fair.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
index 56dd655d9bc2..4e6a57708229 100644
--- a/kernel/sched/fair.c
+++ b/kernel/sched/fair.c
@@ -7861,7 +7861,7 @@ static int select_idle_sibling(struct task_struct *p, int prev, int target)
*/
if (sd) {
i = select_idle_capacity(p, sd, target);
- return ((unsigned)i < nr_cpumask_bits) ? i : target;
+ return ((unsigned int)i < nr_cpumask_bits) ? i : target;
}
}
@@ -7880,7 +7880,7 @@ static int select_idle_sibling(struct task_struct *p, int prev, int target)
}
i = select_idle_cpu(p, sd, has_idle_core, target);
- if ((unsigned)i < nr_cpumask_bits)
+ if ((unsigned int)i < nr_cpumask_bits)
return i;
/*
--
2.43.0
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] sched/fair: fix comma operator misuse in NUMA fault accounting
2025-12-19 8:50 ` [PATCH 1/2] sched/fair: fix comma operator misuse in NUMA fault accounting Zhan Xusheng
@ 2025-12-19 10:54 ` Peter Zijlstra
0 siblings, 0 replies; 4+ messages in thread
From: Peter Zijlstra @ 2025-12-19 10:54 UTC (permalink / raw)
To: Zhan Xusheng; +Cc: Ingo Molnar, linux-sched, linux-kernel, Zhan Xusheng
On Fri, Dec 19, 2025 at 04:50:04PM +0800, Zhan Xusheng wrote:
> Replace the comma operator with separate statements when assigning
> NUMA fault statistics. This improves readability and follows kernel
> coding style.
This is the only one of the lot I would remotely consider applying. The
rest is just noise. Please don't do style patches.
>
> Signed-off-by: Zhan Xusheng <zhanxusheng@xiaomi.com>
> ---
> kernel/sched/fair.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c
> index da46c3164537..56dd655d9bc2 100644
> --- a/kernel/sched/fair.c
> +++ b/kernel/sched/fair.c
> @@ -13957,7 +13957,7 @@ void show_numa_stats(struct task_struct *p, struct seq_file *m)
> tpf = p->numa_faults[task_faults_idx(NUMA_MEM, node, 1)];
> }
> if (ng) {
> - gsf = ng->faults[task_faults_idx(NUMA_MEM, node, 0)],
> + gsf = ng->faults[task_faults_idx(NUMA_MEM, node, 0)];
> gpf = ng->faults[task_faults_idx(NUMA_MEM, node, 1)];
> }
> print_numa_stats(m, node, tsf, tpf, gsf, gpf);
> --
> 2.43.0
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2025-12-19 10:54 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-12-19 8:50 [PATCH 0/2] sched/fair: cleanups and readability fixes Zhan Xusheng
2025-12-19 8:50 ` [PATCH 1/2] sched/fair: fix comma operator misuse in NUMA fault accounting Zhan Xusheng
2025-12-19 10:54 ` Peter Zijlstra
2025-12-19 8:50 ` [PATCH 2/2] sched/fair: replace bare 'unsigned' with 'unsigned int' Zhan Xusheng
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®