From: Marek Szyprowski <m.szyprowski@samsung.com>
To: Christian Brauner <brauner@kernel.org>
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 15:16:54 +0100 [thread overview]
Message-ID: <fb8a52ae-8366-4122-b2ad-2d0fbc669be8@samsung.com> (raw)
In-Reply-To: <20241213-untypisch-bildmaterial-413504dd3a53@brauner>
On 13.12.2024 14:07, Christian Brauner wrote:
> 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.
I've applied this patch:
https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git/commit/?h=vfs-6.14.pidfs&id=34a0a75fd0887b599d68088b1dd40b3e48cfdc42
onto next-20241213 and it fixed my issue. Thanks!
Feel free to add:
Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
Best regards
--
Marek Szyprowski, PhD
Samsung R&D Institute Poland
next prev parent reply other threads:[~2024-12-13 14:17 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
2024-12-13 14:16 ` Marek Szyprowski [this message]
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=fb8a52ae-8366-4122-b2ad-2d0fbc669be8@samsung.com \
--to=m.szyprowski@samsung.com \
--cc=Liam.Howlett@oracle.com \
--cc=brauner@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--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.