mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tycho Andersen <tycho@kernel.org>
To: Mateusz Guzik <mjguzik@gmail.com>
Cc: Oleg Nesterov <oleg@redhat.com>,
	Christian Brauner <brauner@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] pid: remove unnecessary idr_preload()
Date: Tue, 16 Dec 2025 08:36:02 -0700	[thread overview]
Message-ID: <aUF8Yif0CNxocq70@tycho.pizza> (raw)
In-Reply-To: <CAGudoHHgBwsN8SQBOGOD5ak1V2a6Fnr1jPPUS3VLNaxOpiyBSg@mail.gmail.com>

On Tue, Dec 16, 2025 at 11:02:33AM +0100, Mateusz Guzik wrote:
> On Tue, Dec 16, 2025 at 10:44 AM Oleg Nesterov <oleg@redhat.com> wrote:
> >
> > On 12/15, Tycho Andersen wrote:
> > >
> > > From: "Tycho Andersen (AMD)" <tycho@kernel.org>
> > >
> > > As near as I can tell, nothing in the second pidmap_lock critical section
> > > actually allocates an id, so there is no need to do idr_preload().
> > > idr_replace() does not, nor does pidfs_add_pid().
> >
> > Yes. The extra idr_preload() was needed for pidfs_add_pid() after the commit
> > 9698d5a483654 ("pidfs: rework inode number allocation").
> >
> > But please see
> > [PATCH v3 2/2] pid: only take pidmap_lock once on alloc
> > https://lore.kernel.org/all/20251206131955.780557-3-mjguzik@gmail.com/
> >
> > This patch removes the unnecessary idr_preload() too.
> >
> 
> The patch can be trivially rebased on top of this one (actual rebase
> would be cumbersome; instead one can cp kernel/fork.c
> kernel/fork.c-tmp, apply this patch on top of stock file, mv
> kernel/fork.c-tmp kernel/fork.c and commit resulting diff).
> 
> However, unless someone is looking to put this into stable branches or
> similar, I think the dance can be skipped at no loss for future
> generations.

Yeah, agreed. I think let's just take yours. I'll test it now.

Tycho

      reply	other threads:[~2025-12-16 15:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-15 20:15 Tycho Andersen
2025-12-16  9:39 ` Oleg Nesterov
2025-12-16 15:35   ` Tycho Andersen
2025-12-16  9:44 ` Oleg Nesterov
2025-12-16 10:02   ` Mateusz Guzik
2025-12-16 15:36     ` Tycho Andersen [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=aUF8Yif0CNxocq70@tycho.pizza \
    --to=tycho@kernel.org \
    --cc=brauner@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mjguzik@gmail.com \
    --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

all inboxes | Powered by JetHome®