Skip to contentSkip to conversation

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

PATCH Applied Enlin Mu 6 participants 8 messages Aug 25 – Sep 5

lore
Share & tools
lore

Enlin Mu

author
#0 lore raw

PATCH v2 1/1 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.

---
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/[email protected]/

---
 kernel/softirq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/softirq.c +2 -2
index 7980a4a232f9..800d81c57302 100644
@@ -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);
 		}
Signature · 1 line
2.39.5
Reviewed-by on v2 1/1
#1 lore raw
Quoted 9 lines · 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.

Quoted 7 lines

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

Sebastian

Reviewed-by on v2 1/1
#2 lore raw
In reply to Enlin Mu
Quoted 9 lines · 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.

Quoted 5 lines

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

LGTM, thanks,

Quoted 19 lines

---
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/[email protected]/
---
kernel/softirq.c | 4 ++--

1 file changed, 2 insertions(+), 2 deletions(-)
kernel/softirq.c +0 -0
index 7980a4a232f9..800d81c57302 100644

kernel/softirq.c static void handle_softirqs(bool ksirqd) · line 652

Quoted 10 lines
kernel/softirq.c +2 -2
@@ -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!

merge bot Applied
#3 lore raw
In reply to Enlin Mu
The following commit has been merged into the irq/core branch of tip:

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 <[email protected]>
AuthorDate:    Tue, 25 Aug 2026 09:15:09 +08:00
Committer:     Thomas Gleixner <[email protected]>
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.

---
 kernel/softirq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/softirq.c +2 -2
index 7980a4a..800d81c 100644
@@ -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);
 		}
Reviewed-by
#4 lore raw
Quoted 23 lines · On 4 September 2026 07:48:16 BST, tip-bot2 for Enlin Mu…

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 <[email protected]>
AuthorDate:    Tue, 25 Aug 2026 09:15:09 +08:00
Committer:     Thomas Gleixner <[email protected]>
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.

Quoted 6 lines

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

https://lore.kernel.org/all/[email protected]/

New tag:

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

Quoted 12 lines

---
kernel/softirq.c | 4 ++--

1 file changed, 2 insertions(+), 2 deletions(-)
kernel/softirq.c +0 -0
index 7980a4a..800d81c 100644

kernel/softirq.c restart: · line 652

Quoted 10 lines
kernel/softirq.c +2 -2
@@ -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/[email protected]/

#5 lore raw
Quoted 4 lines · Bradley Morgan
Quoted 1 line

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

Quoted 8 lines

https://lore.kernel.org/all/[email protected]/

New tag:

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

merge bot Applied
#6 lore raw
In reply to Enlin Mu
The following commit has been merged into the irq/core branch of tip:

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 <[email protected]>
AuthorDate:    Tue, 25 Aug 2026 09:15:09 +08:00
Committer:     Thomas Gleixner <[email protected]>
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.

---
 kernel/softirq.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/softirq.c +2 -2
index 7980a4a..800d81c 100644
@@ -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);
 		}
Reviewed-by
#7 lore raw
Quoted 23 lines · On 5 September 2026 20:00:00 BST, tip-bot2 for Enlin Mu…

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 <[email protected]>
AuthorDate:    Tue, 25 Aug 2026 09:15:09 +08:00
Committer:     Thomas Gleixner <[email protected]>
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.

Quoted 6 lines

Sorry:

Oof. :(

Quoted 12 lines

---
kernel/softirq.c | 4 ++--

1 file changed, 2 insertions(+), 2 deletions(-)
kernel/softirq.c +0 -0
index 7980a4a..800d81c 100644

kernel/softirq.c restart: · line 652

Quoted 10 lines
kernel/softirq.c +2 -2
@@ -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/[email protected]/