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

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.

Oleg.


  reply	other threads:[~2025-12-16  9:40 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 [this message]
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

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=aUEo7kY306q-yC-i@redhat.com \
    --to=oleg@redhat.com \
    --cc=brauner@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tycho@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