[lkml]   [2019]   [Aug]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 4/9] arm/perf: correctly check for kthreads
The arm perf_callchain_user() functions looks at current->mm,
apparently to determine whether the thread is a kthread without any
valid user context.

In general, a non-NULL current->mm doesn't imply that current is a
kthread, as kthreads can install an mm via use_mm(), and so it's
preferable to use is_kthread() to determine whether a thread is a

For consistency, let's use is_kthread() here.

Signed-off-by: Mark Rutland <>
Cc: Will Deacon <>
Cc: Ingo Molnar <>
Cc: Peter Zijlstra <>
arch/arm/kernel/perf_callchain.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/kernel/perf_callchain.c b/arch/arm/kernel/perf_callchain.c
index 3b69a76d341e..5c920f2c46a8 100644
--- a/arch/arm/kernel/perf_callchain.c
+++ b/arch/arm/kernel/perf_callchain.c
@@ -71,7 +71,7 @@ perf_callchain_user(struct perf_callchain_entry_ctx *entry, struct pt_regs *regs

perf_callchain_store(entry, regs->ARM_pc);

- if (!current->mm)
+ if (is_kthread(current))

tail = (struct frame_tail __user *)regs->ARM_fp - 1;
 \ /
  Last update: 2019-08-14 12:43    [W:0.073 / U:24.236 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site