]> www.infradead.org Git - users/willy/xarray.git/commit
get_task_mm: check PF_KTHREAD lockless
authorOleg Nesterov <oleg@redhat.com>
Wed, 26 Jun 2024 19:10:17 +0000 (21:10 +0200)
committerAndrew Morton <akpm@linux-foundation.org>
Fri, 5 Jul 2024 01:05:58 +0000 (18:05 -0700)
commit8ac5dc66599c5c545cefd314dd34a109edce2784
treec2387c3919af3ce2dac11063efa74713b37cf3d1
parentd73d00352145fb51d31771047aa939850d87fa50
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/20240626191017.GA20031@redhat.com
Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
kernel/fork.c