[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241210134513.2179786-1-quic_zhonhan@quicinc.com>
Date: Tue, 10 Dec 2024 21:45:13 +0800
From: Zhongqiu Han <quic_zhonhan@...cinc.com>
To: <mingo@...hat.com>, <peterz@...radead.org>, <juri.lelli@...hat.com>,
<vincent.guittot@...aro.org>, <dietmar.eggemann@....com>,
<rostedt@...dmis.org>, <bsegall@...gle.com>, <mgorman@...e.de>,
<vschneid@...hat.com>
CC: <linux-kernel@...r.kernel.org>, <quic_zhonhan@...cinc.com>
Subject: [RFC PATCH] sched/core: Enhanced debug logs in do_task_dead()
If BUG() is a NOP, dump the problematic stack for debugging purposes.
Signed-off-by: Zhongqiu Han <quic_zhonhan@...cinc.com>
---
If BUG() is a NOP, it should make sense for debugging purposes. However,
just arising the patch with RFC, because at least for now, I haven't found
a definition of BUG() as NOP in various architectures. Thanks~
kernel/sched/core.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index f59f2c0f6e32..fc36a9c5c136 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -6774,7 +6774,11 @@ void __noreturn do_task_dead(void)
__schedule(SM_NONE);
BUG();
- /* Avoid "noreturn function does return" - but don't continue if BUG() is a NOP: */
+ /*
+ * Don't continue if BUG() is a NOP to avoid "noreturn function
+ * does return" and dump stack for this case.
+ */
+ dump_stack();
for (;;)
cpu_relax();
}
--
2.25.1
Powered by blists - more mailing lists