public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tycho Andersen <tycho@kernel.org>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Christian Brauner <brauner@kernel.org>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] pid: remove unnecessary idr_preload()
Date: Tue, 16 Dec 2025 08:35:17 -0700	[thread overview]
Message-ID: <aUF8NT5_i6y85-zc@tycho.pizza> (raw)
In-Reply-To: <aUEo7kY306q-yC-i@redhat.com>

On Tue, Dec 16, 2025 at 10:39:58AM +0100, Oleg Nesterov 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/

Oh, nice. I was looking at doing this too. I'll head over to that
thread...

Tycho

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

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-15 20:15 [PATCH] pid: remove unnecessary idr_preload() Tycho Andersen
2025-12-16  9:39 ` Oleg Nesterov
2025-12-16 15:35   ` Tycho Andersen [this message]
2025-12-16  9:44 ` Oleg Nesterov
2025-12-16 10:02   ` Mateusz Guzik
2025-12-16 15:36     ` Tycho Andersen

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=aUF8NT5_i6y85-zc@tycho.pizza \
    --to=tycho@kernel.org \
    --cc=brauner@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