From: Pavel Begunkov <asml.silence@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: Jens Axboe <axboe@kernel.dk>
Subject: [RFC] exit: do exit_task_work() before shooting off mm
Date: Thu, 3 Dec 2020 02:30:46 +0000 [thread overview]
Message-ID: <abab9af4e0d26358538a45a2826650e9cefd2924.1606961931.git.asml.silence@gmail.com> (raw)
Handle task works and lock it earlier before it starts killing off
task's resources like mm. io_uring makes use of it a lot and it'd
nicer to have all added task_work finding tasks in a consistent state.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
---
Would it be correct? I clearly don't know all the exit invariants, but
can't find any users relying on task_works in-between.
kernel/exit.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/exit.c b/kernel/exit.c
index 1f236ed375f8..c2a0cffd824d 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -763,6 +763,7 @@ void __noreturn do_exit(long code)
}
exit_signals(tsk); /* sets PF_EXITING */
+ exit_task_work(tsk);
/* sync mm's RSS info before statistics gathering */
if (tsk->mm)
@@ -806,7 +807,6 @@ void __noreturn do_exit(long code)
if (group_dead)
disassociate_ctty(1);
exit_task_namespaces(tsk);
- exit_task_work(tsk);
exit_thread(tsk);
/*
--
2.24.0
next reply other threads:[~2020-12-03 2:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-12-03 2:30 Pavel Begunkov [this message]
2020-12-08 1:37 ` Al Viro
2020-12-08 3:00 ` Pavel Begunkov
2020-12-20 12:50 ` Pavel Begunkov
2020-12-20 13:58 ` Oleg Nesterov
2020-12-20 14:42 ` Pavel Begunkov
2020-12-14 14:51 ` [exit] 80fae08355: stderr.mount:/fs/sda1:/dev/sda1_already_mounted_or_mount_point_busy kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=abab9af4e0d26358538a45a2826650e9cefd2924.1606961931.git.asml.silence@gmail.com \
--to=asml.silence@gmail.com \
--cc=axboe@kernel.dk \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®