diff mbox series

proc/softirqs: change softirqs info from possile_cpu to online_cpu

Message ID 20241108162225.19401-1-18001123162@163.com (mailing list archive)
State New
Headers show
Series proc/softirqs: change softirqs info from possile_cpu to online_cpu | expand

Commit Message

enlin.mu Nov. 8, 2024, 4:22 p.m. UTC
From: Enlin Mu <enlin.mu@unisoc.com>

like /proc/interrupts,/proc/softirqs which shows
the number of softirq for each online CPU

Signed-off-by: Enlin Mu <enlin.mu@unisoc.com>
---
 fs/proc/softirqs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Thomas Gleixner Nov. 12, 2024, 2:16 a.m. UTC | #1
On Sat, Nov 09 2024 at 00:22, enlin mu wrote:

> From: Enlin Mu <enlin.mu@unisoc.com>
>
> like /proc/interrupts,/proc/softirqs which shows
> the number of softirq for each online CPU

This changes the output format of a file which is used by various
tools, i.e. this is an ABI change.

Did you validate that none of these tools relies on consecutive CPU
numbers even when CPUs in the middle of the number space are offline?

Thanks,

        tglx
diff mbox series

Patch

diff --git a/fs/proc/softirqs.c b/fs/proc/softirqs.c
index 04bb29721419..01698b8f3898 100644
--- a/fs/proc/softirqs.c
+++ b/fs/proc/softirqs.c
@@ -13,13 +13,13 @@  static int show_softirqs(struct seq_file *p, void *v)
 	int i, j;
 
 	seq_puts(p, "                    ");
-	for_each_possible_cpu(i)
+	for_each_online_cpu(i)
 		seq_printf(p, "CPU%-8d", i);
 	seq_putc(p, '\n');
 
 	for (i = 0; i < NR_SOFTIRQS; i++) {
 		seq_printf(p, "%12s:", softirq_to_name[i]);
-		for_each_possible_cpu(j)
+		for_each_online_cpu(j)
 			seq_put_decimal_ull_width(p, " ", kstat_softirqs_cpu(i, j), 10);
 		seq_putc(p, '\n');
 	}