From: Matthew Wilcox <willy@infradead.org>
To: Christian Brauner <brauner@kernel.org>
Cc: "Liam R. Howlett" <Liam.Howlett@oracle.com>,
linux-fsdevel@vger.kernel.org, maple-tree@lists.infradead.org
Subject: Re: [PATCH RFC v2 0/2] pidfs: use maple tree
Date: Fri, 13 Dec 2024 18:53:55 +0000 [thread overview]
Message-ID: <Z1yCw665MIgFUI3M@casper.infradead.org> (raw)
In-Reply-To: <20241213-kaulquappen-schrank-a585a8b2cc6d@brauner>
On Fri, Dec 13, 2024 at 07:51:50PM +0100, Christian Brauner wrote:
> Yeah, it does. Did you see the patch that is included in the series?
> I've replaced the macro with always inline functions that select the
> lock based on the flag:
>
> static __always_inline void mtree_lock(struct maple_tree *mt)
> {
> if (mt->ma_flags & MT_FLAGS_LOCK_IRQ)
> spin_lock_irq(&mt->ma_lock);
> else
> spin_lock(&mt->ma_lock);
> }
> static __always_inline void mtree_unlock(struct maple_tree *mt)
> {
> if (mt->ma_flags & MT_FLAGS_LOCK_IRQ)
> spin_unlock_irq(&mt->ma_lock);
> else
> spin_unlock(&mt->ma_lock);
> }
>
> Does that work for you?
See the way the XArray works; we're trying to keep the two APIs as
close as possible.
The caller should use mtree_lock_irq() or mtree_lock_irqsave()
as appropriate.
next prev parent reply other threads:[~2024-12-13 18:53 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
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 [this message]
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=Z1yCw665MIgFUI3M@casper.infradead.org \
--to=willy@infradead.org \
--cc=Liam.Howlett@oracle.com \
--cc=brauner@kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=maple-tree@lists.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox