[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250206164415.450051-3-mjguzik@gmail.com>
Date: Thu, 6 Feb 2025 17:44:11 +0100
From: Mateusz Guzik <mjguzik@...il.com>
To: ebiederm@...ssion.com,
oleg@...hat.com
Cc: brauner@...nel.org,
akpm@...ux-foundation.org,
Liam.Howlett@...cle.com,
linux-mm@...ck.org,
linux-kernel@...r.kernel.org,
Mateusz Guzik <mjguzik@...il.com>
Subject: [PATCH v6 2/5] exit: hoist get_pid() in release_task() outside of tasklist_lock
Reduces hold time as get_pid() contains an atomic.
Reviewed-by: Oleg Nesterov <oleg@...hat.com>
Signed-off-by: Mateusz Guzik <mjguzik@...il.com>
---
kernel/exit.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kernel/exit.c b/kernel/exit.c
index 9d7acd7b0040..8c39c84582b7 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -248,9 +248,10 @@ void release_task(struct task_struct *p)
cgroup_release(p);
+ thread_pid = get_pid(p->thread_pid);
+
write_lock_irq(&tasklist_lock);
ptrace_release_task(p);
- thread_pid = get_pid(p->thread_pid);
__exit_signal(p);
/*
--
2.43.0
Powered by blists - more mailing lists