linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eugeniu Rosca <erosca@de.adit-jv.com>
To: <linux-kernel@vger.kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@kernel.org>, Will Deacon <will@kernel.org>,
	Frederic Weisbecker <frederic@kernel.org>,
	Jiafei Pan <Jiafei.Pan@nxp.com>,
	Romain Perier <romain.perier@gmail.com>
Cc: Andrew Gabbasov <andrew_gabbasov@mentor.com>,
	Dirk Behme <dirk.behme@de.bosch.com>,
	Eugeniu Rosca <roscaeugeniu@gmail.com>,
	Eugeniu Rosca <erosca@de.adit-jv.com>
Subject: [PATCH] softirq: Be more verbose on t->state BUG()
Date: Mon, 15 Mar 2021 16:44:21 +0100	[thread overview]
Message-ID: <20210315154421.11463-1-erosca@de.adit-jv.com> (raw)

From: Dirk Behme <dirk.behme@de.bosch.com>

In case this BUG() is hit, it helps debugging a lot to get an idea
what tasklet is the root cause. So, be slightly more verbose here.

Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com>
Signed-off-by: Eugeniu Rosca <erosca@de.adit-jv.com>
---
 kernel/softirq.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/kernel/softirq.c b/kernel/softirq.c
index 9908ec4a9bfe..a6b602ad48d6 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -550,9 +550,13 @@ static void tasklet_action_common(struct softirq_action *a,
 
 		if (tasklet_trylock(t)) {
 			if (!atomic_read(&t->count)) {
-				if (!test_and_clear_bit(TASKLET_STATE_SCHED,
-							&t->state))
+				if (!test_and_clear_bit(TASKLET_STATE_SCHED, &t->state)) {
+					if (t->use_callback)
+						pr_emerg("tasklet failed, cb: %pS\n", t->callback);
+					else
+						pr_emerg("tasklet failed, func: %pS\n", t->func);
 					BUG();
+				}
 				if (t->use_callback)
 					t->callback(t);
 				else
-- 
2.29.0


             reply	other threads:[~2021-03-15 16:34 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-15 15:44 Eugeniu Rosca [this message]
2021-03-16 14:31 ` [PATCH] softirq: Be more verbose on t->state BUG() Thomas Gleixner
2021-03-16 15:10   ` Eugeniu Rosca
2021-03-16 17:13     ` Thomas Gleixner
2021-03-17 10:26       ` Eugeniu Rosca

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210315154421.11463-1-erosca@de.adit-jv.com \
    --to=erosca@de.adit-jv.com \
    --cc=Jiafei.Pan@nxp.com \
    --cc=andrew_gabbasov@mentor.com \
    --cc=dirk.behme@de.bosch.com \
    --cc=frederic@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=romain.perier@gmail.com \
    --cc=roscaeugeniu@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=will@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).