mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2] softirq: Remove redundant h->action from preempt_count mismatch error
@ 2026-08-25  1:15 Enlin Mu
  2026-08-25  6:53 ` Sebastian Andrzej Siewior
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: Enlin Mu @ 2026-08-25  1:15 UTC (permalink / raw)
  To: peterz, tglx, boqun, lyude, bigeasy, joelagnelf, linux-kernel,
	enlin.mu, enlin.mu

When a preempt_count mismatch is detected in handle_softirqs(), the
error message currently prints the softirq action handler (h->action).

However, as Thomas Gleixner pointed out, the action handler for a given
softirq vector is always a known, fixed function (e.g., run_timer_softirq
for TIMER_SOFTIRQ). Printing it provides zero diagnostic value. The real
issue typically lies in the functions invoked *within* that handler, not
the handler entry point itself.

Therefore, as suggested by Sebastian Andrzej Siewior, remove h->action
from the print statement entirely to clean up the error message.

Suggested-by: Thomas Gleixner <tglx@linutronix.de>
Suggested-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Enlin Mu <enlin.mu@unisoc.com>
Signed-off-by: Enlin Mu <enlin.mu@linux.dev>
---
v1 -> v2:
  - Instead of changing %p to %pS, remove h->action from the print
    entirely as suggested by Sebastian and Thomas.
  - Update commit message accordingly.

v1: https://lore.kernel.org/all/20260105094133.3542-1-enlin.mu@linux.dev/
---
 kernel/softirq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/softirq.c b/kernel/softirq.c
index 7980a4a232f9..800d81c57302 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -645,8 +645,8 @@ static void handle_softirqs(bool ksirqd)
 		h->action();
 		trace_softirq_exit(vec_nr);
 		if (unlikely(prev_count != preempt_count())) {
-			pr_err("huh, entered softirq %u %s %p with preempt_count %08x, exited with %08x?\n",
-			       vec_nr, softirq_to_name[vec_nr], h->action,
+			pr_err("huh, entered softirq %u %s with preempt_count %08x, exited with %08x?\n",
+			       vec_nr, softirq_to_name[vec_nr],
 			       prev_count, preempt_count());
 			preempt_count_set(prev_count);
 		}
-- 
2.39.5


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

* Re: [PATCH v2] softirq: Remove redundant h->action from preempt_count mismatch error
  2026-08-25  1:15 [PATCH v2] softirq: Remove redundant h->action from preempt_count mismatch error Enlin Mu
@ 2026-08-25  6:53 ` Sebastian Andrzej Siewior
  2026-08-25 13:08 ` Bradley Morgan
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Sebastian Andrzej Siewior @ 2026-08-25  6:53 UTC (permalink / raw)
  To: Enlin Mu; +Cc: peterz, tglx, boqun, lyude, joelagnelf, linux-kernel, enlin.mu

On 2026-08-25 09:15:09 [+0800], Enlin Mu wrote:
> When a preempt_count mismatch is detected in handle_softirqs(), the
> error message currently prints the softirq action handler (h->action).
> 
> However, as Thomas Gleixner pointed out, the action handler for a given
> softirq vector is always a known, fixed function (e.g., run_timer_softirq
> for TIMER_SOFTIRQ). Printing it provides zero diagnostic value. The real
> issue typically lies in the functions invoked *within* that handler, not
> the handler entry point itself.
> 
> Therefore, as suggested by Sebastian Andrzej Siewior, remove h->action
> from the print statement entirely to clean up the error message.
> 
> Suggested-by: Thomas Gleixner <tglx@linutronix.de>
> Suggested-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
> Signed-off-by: Enlin Mu <enlin.mu@unisoc.com>
> Signed-off-by: Enlin Mu <enlin.mu@linux.dev>

Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

Sebastian

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

* Re: [PATCH v2] softirq: Remove redundant h->action from preempt_count mismatch error
  2026-08-25  1:15 [PATCH v2] softirq: Remove redundant h->action from preempt_count mismatch error Enlin Mu
  2026-08-25  6:53 ` Sebastian Andrzej Siewior
@ 2026-08-25 13:08 ` Bradley Morgan
  2026-09-04  6:48 ` [tip: irq/core] " tip-bot2 for Enlin Mu
  2026-09-05 19:00 ` tip-bot2 for Enlin Mu
  3 siblings, 0 replies; 7+ messages in thread
From: Bradley Morgan @ 2026-08-25 13:08 UTC (permalink / raw)
  To: enlin.mu
  Cc: bigeasy, boqun, enlin.mu, joelagnelf, linux-kernel, lyude, peterz, tglx

On 25 August 2026 02:15:09 BST, Enlin Mu <enlin.mu@linux.dev> wrote:
>When a preempt_count mismatch is detected in handle_softirqs(), the
>error message currently prints the softirq action handler (h->action).
>
>However, as Thomas Gleixner pointed out, the action handler for a given
>softirq vector is always a known, fixed function (e.g., run_timer_softirq
>for TIMER_SOFTIRQ). Printing it provides zero diagnostic value. The real
>issue typically lies in the functions invoked *within* that handler, not
>the handler entry point itself.
>
>Therefore, as suggested by Sebastian Andrzej Siewior, remove h->action
>from the print statement entirely to clean up the error message.
>
>Suggested-by: Thomas Gleixner <tglx@linutronix.de>
>Suggested-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

LGTM, thanks,

Reviewed-by: Bradley Morgan <include@grrlz.net>

>Signed-off-by: Enlin Mu <enlin.mu@unisoc.com>
>Signed-off-by: Enlin Mu <enlin.mu@linux.dev>
>---
>v1 -> v2:
>  - Instead of changing %p to %pS, remove h->action from the print
>    entirely as suggested by Sebastian and Thomas.
>  - Update commit message accordingly.
>
>v1: https://lore.kernel.org/all/20260105094133.3542-1-enlin.mu@linux.dev/
>---
> kernel/softirq.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
>diff --git a/kernel/softirq.c b/kernel/softirq.c
>index 7980a4a232f9..800d81c57302 100644
>--- a/kernel/softirq.c
>+++ b/kernel/softirq.c
>@@ -645,8 +645,8 @@ static void handle_softirqs(bool ksirqd)
> 		h->action();
> 		trace_softirq_exit(vec_nr);
> 		if (unlikely(prev_count != preempt_count())) {
>-			pr_err("huh, entered softirq %u %s %p with preempt_count %08x, exited with %08x?\n",
>-			       vec_nr, softirq_to_name[vec_nr], h->action,
>+			pr_err("huh, entered softirq %u %s with preempt_count %08x, exited with %08x?\n",
>+			       vec_nr, softirq_to_name[vec_nr],
> 			       prev_count, preempt_count());
> 			preempt_count_set(prev_count);
> 		}
>

Thanks!

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

* [tip: irq/core] softirq: Remove redundant h->action from preempt_count mismatch error
  2026-08-25  1:15 [PATCH v2] softirq: Remove redundant h->action from preempt_count mismatch error Enlin Mu
  2026-08-25  6:53 ` Sebastian Andrzej Siewior
  2026-08-25 13:08 ` Bradley Morgan
@ 2026-09-04  6:48 ` tip-bot2 for Enlin Mu
  2026-09-04 10:38   ` Bradley Morgan
  2026-09-05 19:00 ` tip-bot2 for Enlin Mu
  3 siblings, 1 reply; 7+ messages in thread
From: tip-bot2 for Enlin Mu @ 2026-09-04  6:48 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Thomas Gleixner, Sebastian Andrzej Siewior, Enlin Mu, Enlin Mu,
	Thomas Gleixner, x86, linux-kernel, maz

The following commit has been merged into the irq/core branch of tip:

Commit-ID:     67f399a9ac7f3001cafc0cb1b645e3e5760779d2
Gitweb:        https://git.kernel.org/tip/67f399a9ac7f3001cafc0cb1b645e3e5760779d2
Author:        Enlin Mu <enlin.mu@linux.dev>
AuthorDate:    Tue, 25 Aug 2026 09:15:09 +08:00
Committer:     Thomas Gleixner <tglx@kernel.org>
CommitterDate: Fri, 04 Sep 2026 08:45:56 +02:00

softirq: Remove redundant h->action from preempt_count mismatch error

When a preempt_count mismatch is detected in handle_softirqs(), the
error message currently prints the softirq action handler (h->action).

However, as Thomas Gleixner pointed out, the action handler for a given
softirq vector is always a known, fixed function (e.g., run_timer_softirq
for TIMER_SOFTIRQ). Printing it provides zero diagnostic value. The real
issue typically lies in the functions invoked *within* that handler, not
the handler entry point itself.

Therefore, as suggested by Sebastian Andrzej Siewior, remove h->action
from the print statement entirely to clean up the error message.

Suggested-by: Thomas Gleixner <tglx@linutronix.de>
Suggested-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Enlin Mu <enlin.mu@unisoc.com>
Signed-off-by: Enlin Mu <enlin.mu@linux.dev>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Link: https://patch.msgid.link/20260825011509.8505-1-enlin.mu@linux.dev
---
 kernel/softirq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/softirq.c b/kernel/softirq.c
index 7980a4a..800d81c 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -645,8 +645,8 @@ restart:
 		h->action();
 		trace_softirq_exit(vec_nr);
 		if (unlikely(prev_count != preempt_count())) {
-			pr_err("huh, entered softirq %u %s %p with preempt_count %08x, exited with %08x?\n",
-			       vec_nr, softirq_to_name[vec_nr], h->action,
+			pr_err("huh, entered softirq %u %s with preempt_count %08x, exited with %08x?\n",
+			       vec_nr, softirq_to_name[vec_nr],
 			       prev_count, preempt_count());
 			preempt_count_set(prev_count);
 		}

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

* Re: [tip: irq/core] softirq: Remove redundant h->action from preempt_count mismatch error
  2026-09-04  6:48 ` [tip: irq/core] " tip-bot2 for Enlin Mu
@ 2026-09-04 10:38   ` Bradley Morgan
  2026-09-05 18:59     ` Thomas Gleixner
  0 siblings, 1 reply; 7+ messages in thread
From: Bradley Morgan @ 2026-09-04 10:38 UTC (permalink / raw)
  To: tip-bot2
  Cc: bigeasy, enlin.mu, enlin.mu, linux-kernel, linux-tip-commits,
	maz, tglx, tglx, x86

On 4 September 2026 07:48:16 BST, tip-bot2 for Enlin Mu
<tip-bot2@linutronix.de> wrote:
>The following commit has been merged into the irq/core branch of tip:
>
>Commit-ID:     67f399a9ac7f3001cafc0cb1b645e3e5760779d2
>Gitweb:        https://git.kernel.org/tip/67f399a9ac7f3001cafc0cb1b645e3e5760779d2
>Author:        Enlin Mu <enlin.mu@linux.dev>
>AuthorDate:    Tue, 25 Aug 2026 09:15:09 +08:00
>Committer:     Thomas Gleixner <tglx@kernel.org>
>CommitterDate: Fri, 04 Sep 2026 08:45:56 +02:00
>
>softirq: Remove redundant h->action from preempt_count mismatch error
>
>When a preempt_count mismatch is detected in handle_softirqs(), the
>error message currently prints the softirq action handler (h->action).
>
>However, as Thomas Gleixner pointed out, the action handler for a given
>softirq vector is always a known, fixed function (e.g., run_timer_softirq
>for TIMER_SOFTIRQ). Printing it provides zero diagnostic value. The real
>issue typically lies in the functions invoked *within* that handler, not
>the handler entry point itself.
>
>Therefore, as suggested by Sebastian Andrzej Siewior, remove h->action
>from the print statement entirely to clean up the error message.
>
>Suggested-by: Thomas Gleixner <tglx@linutronix.de>
>Suggested-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
>Signed-off-by: Enlin Mu <enlin.mu@unisoc.com>
>Signed-off-by: Enlin Mu <enlin.mu@linux.dev>
>Signed-off-by: Thomas Gleixner <tglx@kernel.org>
>Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

Hi, What's wrong with my tag? I'm sure I provided it! On my old email, see

https://lore.kernel.org/all/A86DF76C-F103-4BD1-A5FF-B4701B7A9FEF@grrlz.net/

New tag:

Reviewed-by: Bradley Morgan <brads@mainlining.org>

if there's anything wrong with my tag, please feel free to tell me and
I'llcomment on it

>Link: https://patch.msgid.link/20260825011509.8505-1-enlin.mu@linux.dev
>---
> kernel/softirq.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
>diff --git a/kernel/softirq.c b/kernel/softirq.c
>index 7980a4a..800d81c 100644
>--- a/kernel/softirq.c
>+++ b/kernel/softirq.c
>@@ -645,8 +645,8 @@ restart:
> 		h->action();
> 		trace_softirq_exit(vec_nr);
> 		if (unlikely(prev_count != preempt_count())) {
>-			pr_err("huh, entered softirq %u %s %p with preempt_count %08x, exited with %08x?\n",
>-			       vec_nr, softirq_to_name[vec_nr], h->action,
>+			pr_err("huh, entered softirq %u %s with preempt_count %08x, exited with %08x?\n",
>+			       vec_nr, softirq_to_name[vec_nr],
> 			       prev_count, preempt_count());
> 			preempt_count_set(prev_count);
> 		}
>
>

--- Thanks!
https://lore.kernel.org/all/EE579805-42F2-4C58-B752-F28779EEB717@grrlz.net/

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

* Re: [tip: irq/core] softirq: Remove redundant h->action from preempt_count mismatch error
  2026-09-04 10:38   ` Bradley Morgan
@ 2026-09-05 18:59     ` Thomas Gleixner
  0 siblings, 0 replies; 7+ messages in thread
From: Thomas Gleixner @ 2026-09-05 18:59 UTC (permalink / raw)
  To: Bradley Morgan, tip-bot2
  Cc: bigeasy, enlin.mu, enlin.mu, linux-kernel, linux-tip-commits, maz, x86

On Fri, Sep 04 2026 at 11:38, Bradley Morgan wrote:
>>Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
>
> Hi, What's wrong with my tag? I'm sure I provided it! On my old email, see
>
> https://lore.kernel.org/all/A86DF76C-F103-4BD1-A5FF-B4701B7A9FEF@grrlz.net/
>
> New tag:
>
> Reviewed-by: Bradley Morgan <brads@mainlining.org>
>
> if there's anything wrong with my tag, please feel free to tell me and
> I'llcomment on it

Nothing wrong. The script collecting the patch ran before your mail
arrived, but I merged it the day after because I got distracted and did
not rerun the fetch.

I've amended it now only because I just noticed when reading your mail
that Elin's SOB was there twice and I had to fix that up anyway.

Thanks

        tglx

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

* [tip: irq/core] softirq: Remove redundant h->action from preempt_count mismatch error
  2026-08-25  1:15 [PATCH v2] softirq: Remove redundant h->action from preempt_count mismatch error Enlin Mu
                   ` (2 preceding siblings ...)
  2026-09-04  6:48 ` [tip: irq/core] " tip-bot2 for Enlin Mu
@ 2026-09-05 19:00 ` tip-bot2 for Enlin Mu
  3 siblings, 0 replies; 7+ messages in thread
From: tip-bot2 for Enlin Mu @ 2026-09-05 19:00 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Thomas Gleixner, Sebastian Andrzej Siewior, Enlin Mu,
	Thomas Gleixner, Bradley Morgan, x86, linux-kernel, maz

The following commit has been merged into the irq/core branch of tip:

Commit-ID:     a0e1fdb96578ea562a03c487f70673d228824d0a
Gitweb:        https://git.kernel.org/tip/a0e1fdb96578ea562a03c487f70673d228824d0a
Author:        Enlin Mu <enlin.mu@linux.dev>
AuthorDate:    Tue, 25 Aug 2026 09:15:09 +08:00
Committer:     Thomas Gleixner <tglx@kernel.org>
CommitterDate: Sat, 05 Sep 2026 20:52:12 +02:00

softirq: Remove redundant h->action from preempt_count mismatch error

When a preempt_count mismatch is detected in handle_softirqs(), the
error message currently prints the softirq action handler (h->action).

However, as Thomas Gleixner pointed out, the action handler for a given
softirq vector is always a known, fixed function (e.g., run_timer_softirq
for TIMER_SOFTIRQ). Printing it provides zero diagnostic value. The real
issue typically lies in the functions invoked *within* that handler, not
the handler entry point itself.

Therefore, as suggested by Sebastian Andrzej Siewior, remove h->action
from the print statement entirely to clean up the error message.

Suggested-by: Thomas Gleixner <tglx@linutronix.de>
Suggested-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Enlin Mu <enlin.mu@linux.dev>
Signed-off-by: Thomas Gleixner <tglx@kernel.org>
Reviewed-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Reviewed-by: Bradley Morgan <include@grrlz.net>
Link: https://patch.msgid.link/20260825011509.8505-1-enlin.mu@linux.dev
---
 kernel/softirq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/softirq.c b/kernel/softirq.c
index 7980a4a..800d81c 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -645,8 +645,8 @@ restart:
 		h->action();
 		trace_softirq_exit(vec_nr);
 		if (unlikely(prev_count != preempt_count())) {
-			pr_err("huh, entered softirq %u %s %p with preempt_count %08x, exited with %08x?\n",
-			       vec_nr, softirq_to_name[vec_nr], h->action,
+			pr_err("huh, entered softirq %u %s with preempt_count %08x, exited with %08x?\n",
+			       vec_nr, softirq_to_name[vec_nr],
 			       prev_count, preempt_count());
 			preempt_count_set(prev_count);
 		}

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

end of thread, other threads:[~2026-09-05 19:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-08-25  1:15 [PATCH v2] softirq: Remove redundant h->action from preempt_count mismatch error Enlin Mu
2026-08-25  6:53 ` Sebastian Andrzej Siewior
2026-08-25 13:08 ` Bradley Morgan
2026-09-04  6:48 ` [tip: irq/core] " tip-bot2 for Enlin Mu
2026-09-04 10:38   ` Bradley Morgan
2026-09-05 18:59     ` Thomas Gleixner
2026-09-05 19:00 ` tip-bot2 for Enlin Mu

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®