On 6/25/25 5:15 PM, Steven Rostedt wrote:
> From: Steven Rostedt <[email protected]>
> 
> To determine if a task is a kernel thread or not, it is more reliable to
> use (current->flags & PF_KTHREAD) than to rely on current->mm being NULL.
> That is because some kernel tasks (io_uring helpers) may have a mm field.

This commit message is very odd, imho, and wrong. To check if it's a
kernel thread yes you should use PF_KTHREAD, but that has nothing to do
with PF_USER_WORKER. In fact, as mentioned in a previous reply,
current->mm may be non-NULL for a kthread as well, if it's done
kthread_use_mm().

If the current check for "is kernel thread" was using ->mm to gauge
then, then the current check was just wrong, period.

-- 
Jens Axboe

Reply via email to