]> www.infradead.org Git - users/jedix/linux-maple.git/commit
get_task_exe_file: check PF_KTHREAD locklessly
authorMateusz Guzik <mjguzik@gmail.com>
Tue, 19 Nov 2024 14:35:26 +0000 (15:35 +0100)
committerAndrew Morton <akpm@linux-foundation.org>
Mon, 13 Jan 2025 04:21:06 +0000 (20:21 -0800)
commit51f8bd6db591689fa1c67628b4cfe9778e76be6d
treeb3336ea1a3902a189e9ccc49af2f0b44dd638648
parent93b6bd40688ba17225ba8c5f28e8ccb713359b05
get_task_exe_file: check PF_KTHREAD locklessly

Same thing as 8ac5dc66599c ("get_task_mm: check PF_KTHREAD lockless")

Nowadays PF_KTHREAD is sticky and it was never protected by ->alloc_lock.
Move the PF_KTHREAD check outside of task_lock() section to make this code
more understandable.

Link: https://lkml.kernel.org/r/20241119143526.704986-1-mjguzik@gmail.com
Signed-off-by: Mateusz Guzik <mjguzik@gmail.com>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
kernel/fork.c