From: Jiri Slaby <jirislaby@kernel.org>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
"Eric W. Biederman" <ebiederm@xmission.com>,
Christian Brauner <brauner@kernel.org>,
Kees Cook <keescook@chromium.org>,
linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] kill do_each_thread()
Date: Fri, 18 Aug 2023 10:25:26 +0200 [thread overview]
Message-ID: <c6c86d68-dcae-2397-a3f3-aca7bff93d6c@kernel.org> (raw)
In-Reply-To: <20230818081617.GA5339@redhat.com>
On 18. 08. 23, 10:16, Oleg Nesterov wrote:
> On 08/18, Jiri Slaby wrote:
>>
>> On 17. 08. 23, 18:37, Oleg Nesterov wrote:
>>> Eric has pointed out that we still have 3 users of do_each_thread().
>>> Change them to use for_each_process_thread() and kill this helper.
>>
>> Is there any change in behavior?
>
> No.
>
> Well, there is a subtle change, after do_each_thread/while_each_thread
> g == t == &init_task, while after for_each_process_thread() they both
> point to nowhere, but this doesn't matter.
>
>> Why is for_each_process_thread() better than do_each_thread()?
>
> Say, for_each_process_thread() is rcu safe, do_each_thread() is not.
>
> And certainly
>
> for_each_process_thread(p, t) {
> do_something(p, t);
> }
>
> looks better than
>
> do_each_thread(p, t) {
> do_something(p, t);
> } while_each_thread(p, t);
>
> And again, there are only 3 users of this awkward helper left.
> It should have been killed years ago and in fact I thought it
> had already been killed. It uses while_each_thread() which needs
> some changes.
Sounds like a perfect commit log now... Unless squashed to the patch, it
will be Linked at least. Thanks for explanation.
--
js
suse labs
prev parent reply other threads:[~2023-08-18 8:26 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-17 16:37 [PATCH] kill do_each_thread() Oleg Nesterov
2023-08-17 16:53 ` Kees Cook
2023-08-18 6:04 ` Jiri Slaby
2023-08-18 8:16 ` Oleg Nesterov
2023-08-18 8:25 ` Jiri Slaby [this message]
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=c6c86d68-dcae-2397-a3f3-aca7bff93d6c@kernel.org \
--to=jirislaby@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=brauner@kernel.org \
--cc=ebiederm@xmission.com \
--cc=keescook@chromium.org \
--cc=linux-ia64@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oleg@redhat.com \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).