All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Brauner <brauner@kernel.org>
To: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: "Liam R. Howlett" <Liam.Howlett@oracle.com>,
	 Matthew Wilcox <willy@infradead.org>,
	linux-fsdevel@vger.kernel.org, maple-tree@lists.infradead.org
Subject: Re: [PATCH RFC v2 2/2] pidfs: use maple tree
Date: Fri, 13 Dec 2024 14:07:23 +0100	[thread overview]
Message-ID: <20241213-untypisch-bildmaterial-413504dd3a53@brauner> (raw)
In-Reply-To: <e3b555c5-4aff-4f0d-b45b-9c46240a02da@samsung.com>

On Fri, Dec 13, 2024 at 11:35:48AM +0100, Marek Szyprowski wrote:
> On 09.12.2024 14:46, Christian Brauner wrote:
> > So far we've been using an idr to track pidfs inodes. For some time now
> > each struct pid has a unique 64bit value that is used as the inode
> > number on 64 bit. That unique inode couldn't be used for looking up a
> > specific struct pid though.
> >
> > Now that we support file handles we need this ability while avoiding to
> > leak actual pid identifiers into userspace which can be problematic in
> > containers.
> >
> > So far I had used an idr-based mechanism where the idr is used to
> > generate a 32 bit number and each time it wraps we increment an upper
> > bit value and generate a unique 64 bit value. The lower 32 bits are used
> > to lookup the pid.
> >
> > I've been looking at the maple tree because it now has
> > mas_alloc_cyclic(). Since it uses unsigned long it would simplify the
> > 64bit implementation and its dense node mode supposedly also helps to
> > mitigate fragmentation.
> >
> > Signed-off-by: Christian Brauner <brauner@kernel.org>
> 
> This patch landed in today's linux-next as commit a2c8e88a30f7 ("pidfs: 
> use maple tree"). In my tests I found that it triggers the following 
> lockdep warning, what probably means that something has not been 
> properly initialized:

Ah, no, I think the issue that it didn't use irq{save,restore} spin lock
variants in that codepath as this is free_pid() which needs it.

I pushed a fix. Please yell if this issue persists.

  reply	other threads:[~2024-12-13 13:07 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-09 13:46 [PATCH RFC v2 0/2] pidfs: use maple tree Christian Brauner
2024-12-09 13:46 ` [PATCH RFC v2 1/2] maple_tree: make MT_FLAGS_LOCK_IRQ do something Christian Brauner
2024-12-09 13:46 ` [PATCH RFC v2 2/2] pidfs: use maple tree Christian Brauner
2024-12-13 10:35   ` Marek Szyprowski
2024-12-13 13:07     ` Christian Brauner [this message]
2024-12-13 14:16       ` Marek Szyprowski
2024-12-13 14:40 ` [PATCH RFC v2 0/2] " Liam R. Howlett
2024-12-13 18:51   ` Christian Brauner
2024-12-13 18:53     ` Matthew Wilcox
2024-12-13 19:01       ` Christian Brauner
2024-12-13 19:25         ` Christian Brauner
2024-12-13 20:11           ` Christian Brauner
2024-12-13 20:50             ` Christian Brauner
2024-12-13 21:07               ` Christian Brauner
2024-12-13 21:16                 ` Liam R. Howlett
2024-12-13 21:13               ` Liam R. Howlett
2024-12-13 21:04             ` Liam R. Howlett
2024-12-14 11:48               ` Christian Brauner
2024-12-17 17:41                 ` Liam R. Howlett

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=20241213-untypisch-bildmaterial-413504dd3a53@brauner \
    --to=brauner@kernel.org \
    --cc=Liam.Howlett@oracle.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=maple-tree@lists.infradead.org \
    --cc=willy@infradead.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.