From: Jiazi Li <jqqlijiazi@gmail.com>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Jiazi Li <jqqlijiazi@gmail.com>,
linux-kernel@vger.kernel.org,
"peixuan.qiu" <peixuan.qiu@transsion.com>
Subject: [PATCH] stacktrace: do not trace user stack for user_worker tasks
Date: Mon, 23 Jun 2025 19:59:11 +0800 [thread overview]
Message-ID: <20250623115914.12076-1-jqqlijiazi@gmail.com> (raw)
Tasks with PF_USER_WORKER flag also only run in kernel space,
so do not trace user stack for these tasks.
Signed-off-by: Jiazi Li <jqqlijiazi@gmail.com>
Signed-off-by: peixuan.qiu <peixuan.qiu@transsion.com>
---
kernel/stacktrace.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/kernel/stacktrace.c b/kernel/stacktrace.c
index afb3c116da91..82fbccdd1a24 100644
--- a/kernel/stacktrace.c
+++ b/kernel/stacktrace.c
@@ -228,8 +228,8 @@ unsigned int stack_trace_save_user(unsigned long *store, unsigned int size)
.size = size,
};
- /* Trace user stack if not a kernel thread */
- if (current->flags & PF_KTHREAD)
+ /* Skip tasks that do not return to userspace */
+ if (current->flags & (PF_KTHREAD | PF_USER_WORKER))
return 0;
arch_stack_walk_user(consume_entry, &c, task_pt_regs(current));
--
2.49.0
next reply other threads:[~2025-06-23 11:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-23 11:59 Jiazi Li [this message]
2025-06-24 17:07 ` Steven Rostedt
2025-06-25 10:00 ` Jiazi Li
2025-06-25 16:23 ` Jens Axboe
2025-06-25 20:50 ` Steven Rostedt
2025-06-25 22:30 ` Jens Axboe
2025-06-25 22:41 ` Steven Rostedt
2025-06-25 23:54 ` Keith Busch
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=20250623115914.12076-1-jqqlijiazi@gmail.com \
--to=jqqlijiazi@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peixuan.qiu@transsion.com \
--cc=rostedt@goodmis.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
all inboxes | Powered by JetHome®