linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fs/proc: add short desc for /proc/softirqs
@ 2020-07-01 14:35 zhenwei pi
  2020-07-01 18:14 ` Alexey Dobriyan
  0 siblings, 1 reply; 2+ messages in thread
From: zhenwei pi @ 2020-07-01 14:35 UTC (permalink / raw)
  To: adobriyan; +Cc: tglx, kzak, linux-kernel, linux-fsdevel, zhenwei pi

Only softirq name is not friendly to end-users, typically 'HI' is
difficult to understand. During developing irqtop/lsirq utilities
for util-linux, Karel Zak considered that we should give more
information to end-users. Discuss about this:
    https://github.com/karelzak/util-linux/pull/1079

Add short desc for /proc/softirqs in this patch, then /proc/softirqs
gets more human-readable.

Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
---
 fs/proc/softirqs.c        |  2 +-
 include/linux/interrupt.h |  5 +++--
 kernel/softirq.c          | 12 ++++++++++++
 3 files changed, 16 insertions(+), 3 deletions(-)

diff --git a/fs/proc/softirqs.c b/fs/proc/softirqs.c
index 12901dc..fcd21f3 100644
--- a/fs/proc/softirqs.c
+++ b/fs/proc/softirqs.c
@@ -20,7 +20,7 @@ static int show_softirqs(struct seq_file *p, void *v)
 		seq_printf(p, "%12s:", softirq_to_name[i]);
 		for_each_possible_cpu(j)
 			seq_printf(p, " %10u", kstat_softirqs_cpu(i, j));
-		seq_putc(p, '\n');
+		seq_printf(p, "  %s\n", softirq_to_desc[i]);
 	}
 	return 0;
 }
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 5db970b..1d51397 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -543,10 +543,11 @@ enum
 
 #define SOFTIRQ_STOP_IDLE_MASK (~(1 << RCU_SOFTIRQ))
 
-/* map softirq index to softirq name. update 'softirq_to_name' in
- * kernel/softirq.c when adding a new softirq.
+/* map softirq index to softirq name. update 'softirq_to_name' &
+ * 'softirq_to_desc' in kernel/softirq.c when adding a new softirq.
  */
 extern const char * const softirq_to_name[NR_SOFTIRQS];
+extern const char * const softirq_to_desc[NR_SOFTIRQS];
 
 /* softirq mask and active fields moved to irq_cpustat_t in
  * asm/hardirq.h to get better cache usage.  KAO
diff --git a/kernel/softirq.c b/kernel/softirq.c
index c4201b7f..74eca3b 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -61,6 +61,18 @@ const char * const softirq_to_name[NR_SOFTIRQS] = {
 	"TASKLET", "SCHED", "HRTIMER", "RCU"
 };
 
+const char * const softirq_to_desc[NR_SOFTIRQS] = {
+	"high priority tasklet softirq",
+	"timer softirq",
+	"network transmit softirq",
+	"network receive softirq",
+	"block device softirq",
+	"IO poll softirq",
+	"normal priority tasklet softirq",
+	"schedule softirq",
+	"high resolution timer softirq",
+	"RCU softirq"
+};
 /*
  * we cannot loop indefinitely here to avoid userspace starvation,
  * but we also don't want to introduce a worst case 1/HZ latency
-- 
2.7.4


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

* Re: [PATCH] fs/proc: add short desc for /proc/softirqs
  2020-07-01 14:35 [PATCH] fs/proc: add short desc for /proc/softirqs zhenwei pi
@ 2020-07-01 18:14 ` Alexey Dobriyan
  0 siblings, 0 replies; 2+ messages in thread
From: Alexey Dobriyan @ 2020-07-01 18:14 UTC (permalink / raw)
  To: zhenwei pi; +Cc: tglx, kzak, linux-kernel, linux-fsdevel

On Wed, Jul 01, 2020 at 10:35:03PM +0800, zhenwei pi wrote:
> Only softirq name is not friendly to end-users, typically 'HI' is
> difficult to understand. During developing irqtop/lsirq utilities
> for util-linux, Karel Zak considered that we should give more
> information to end-users. Discuss about this:
>     https://github.com/karelzak/util-linux/pull/1079
> 
> Add short desc for /proc/softirqs in this patch, then /proc/softirqs
> gets more human-readable.

> --- a/fs/proc/softirqs.c
> +++ b/fs/proc/softirqs.c
> @@ -20,7 +20,7 @@ static int show_softirqs(struct seq_file *p, void *v)
>  		seq_printf(p, "%12s:", softirq_to_name[i]);
>  		for_each_possible_cpu(j)
>  			seq_printf(p, " %10u", kstat_softirqs_cpu(i, j));
> -		seq_putc(p, '\n');
> +		seq_printf(p, "  %s\n", softirq_to_desc[i]);

This could break parsers. I'd rather leave it as is and update proc(5).

Of course this file doesn't need more characters in it. :-\

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

end of thread, other threads:[~2020-07-01 18:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-01 14:35 [PATCH] fs/proc: add short desc for /proc/softirqs zhenwei pi
2020-07-01 18:14 ` Alexey Dobriyan

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).