linux-ia64.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Jiri Slaby <jirislaby@kernel.org>
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:16:17 +0200	[thread overview]
Message-ID: <20230818081617.GA5339@redhat.com> (raw)
In-Reply-To: <d92e7938-49e0-3b4c-89ab-77dcd15b8676@kernel.org>

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.

Oleg.


  reply	other threads:[~2023-08-18  8:18 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 [this message]
2023-08-18  8:25     ` Jiri Slaby

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=20230818081617.GA5339@redhat.com \
    --to=oleg@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=brauner@kernel.org \
    --cc=ebiederm@xmission.com \
    --cc=jirislaby@kernel.org \
    --cc=keescook@chromium.org \
    --cc=linux-ia64@vger.kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).