From: Luis Henriques <luis@igalia.com>
To: Bernd Schubert <bernd@bsbernd.com>
Cc: Bernd Schubert via B4 Relay
<devnull+bernd.bsbernd.com@kernel.org>,
Miklos Szeredi <miklos@szeredi.hu>,
Joanne Koong <joannelkoong@gmail.com>,
linux-fsdevel@vger.kernel.org, Gang He <dchg2000@gmail.com>,
Bernd Schubert <bschubert@ddn.com>
Subject: Re: [PATCH v4 3/8] fuse: {io-uring} Use bitmaps to track registered queues
Date: Mon, 27 Apr 2026 09:02:38 +0100 [thread overview]
Message-ID: <87v7dckezl.fsf@igalia.com> (raw)
In-Reply-To: <859fb89e-81b3-4b49-bd80-532bc7be1395@bsbernd.com> (Bernd Schubert's message of "Fri, 24 Apr 2026 17:33:20 +0200")
On Fri, Apr 24 2026, Bernd Schubert wrote:
> On 4/24/26 17:04, Luis Henriques wrote:
>> On Mon, Apr 13 2026, Bernd Schubert via B4 Relay wrote:
>>
>>> From: Bernd Schubert <bschubert@ddn.com>
>>>
>>> Add per-CPU and per-NUMA node bitmasks to track which
>>> io-uring queues are registered.
>>>
>>> Signed-off-by: Bernd Schubert <bschubert@ddn.com>
>>> ---
>>> fs/fuse/dev_uring.c | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++
>>> fs/fuse/dev_uring_i.h | 20 ++++++++++++++
>>> 2 files changed, 93 insertions(+)
>>>
>>> diff --git a/fs/fuse/dev_uring.c b/fs/fuse/dev_uring.c
>>> index 08c49e5b65ee950a9749a034b1e9d0a8883e1d31..1d1305d38efa07641128a865aec1745d2e040b93 100644
>>> --- a/fs/fuse/dev_uring.c
>>> +++ b/fs/fuse/dev_uring.c
>>> @@ -186,6 +186,25 @@ bool fuse_uring_request_expired(struct fuse_conn *fc)
>>> return false;
>>> }
>>>
>>> +static void fuse_ring_destruct_q_map(struct fuse_queue_map *q_map)
>>> +{
>>> + free_cpumask_var(q_map->registered_q_mask);
>>> + kfree(q_map->cpu_to_qid);
>>> +}
>>> +
>>> +static void fuse_uring_destruct_q_masks(struct fuse_ring *ring)
>>> +{
>>> + int node;
>>> +
>>> + fuse_ring_destruct_q_map(&ring->q_map);
>>> +
>>> + if (ring->numa_q_map) {
>>> + for (node = 0; node < ring->nr_numa_nodes; node++)
>>> + fuse_ring_destruct_q_map(&ring->numa_q_map[node]);
>>> + kfree(ring->numa_q_map);
>>> + }
>>> +}
>>> +
>>> void fuse_uring_destruct(struct fuse_conn *fc)
>>> {
>>> struct fuse_ring *ring = fc->ring;
>>> @@ -217,11 +236,44 @@ void fuse_uring_destruct(struct fuse_conn *fc)
>>> ring->queues[qid] = NULL;
>>> }
>>>
>>> + fuse_uring_destruct_q_masks(ring);
>>> kfree(ring->queues);
>>> kfree(ring);
>>> fc->ring = NULL;
>>> }
>>>
>>> +static int fuse_uring_init_q_map(struct fuse_queue_map *q_map, size_t nr_cpu)
>>> +{
>>> + if (!zalloc_cpumask_var(&q_map->registered_q_mask, GFP_KERNEL_ACCOUNT))
>>> + return -ENOMEM;
>>> +
>>> + q_map->cpu_to_qid = kzalloc_objs(*q_map->cpu_to_qid, nr_cpu,
>>> + GFP_KERNEL_ACCOUNT);
>>> +
>>
>> Missing NULL check here (and corresponding call to free_cpumask_var()).
>>
>>>
>>> + return 0;
>>> +}
>>> +
>>> +static int fuse_uring_create_q_masks(struct fuse_ring *ring)
>>> +{
>>> + int err, node;
>>> +
>>> + err = fuse_uring_init_q_map(&ring->q_map, ring->max_nr_queues);
>>> + if (err)
>>> + return err;
>>> +
>>> + ring->numa_q_map = kzalloc_objs(*ring->numa_q_map, ring->nr_numa_nodes,
>>> + GFP_KERNEL_ACCOUNT);
>>> + if (!ring->numa_q_map)
>>> + return -ENOMEM;
>>
>> Missing call to fuse_ring_destruct_q_map().
>>
>>> + for (node = 0; node < ring->nr_numa_nodes; node++) {
>>> + err = fuse_uring_init_q_map(&ring->numa_q_map[node],
>>> + ring->max_nr_queues);
>>> + if (err)
>>> + return err;
>>
>> Cleanup also missing here.
>
> I don't think so, for either of both, see error handling in
> fuse_uring_create_q_masks().
Doh! you're right. The only fuse_uring_create_q_masks() call site is
fuse_uring_create(), which will then call fuse_uring_destruct_q_masks() on
error. Sorry for the noise :-/
Cheers,
--
Luís
next prev parent reply other threads:[~2026-04-27 8:02 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-13 9:41 [PATCH v4 0/8] fuse: {io-uring} Allow to reduce the number of queues and request distribution Bernd Schubert via B4 Relay
2026-04-13 9:41 ` [PATCH v4 1/8] fuse: {io-uring} Add queue length counters Bernd Schubert via B4 Relay
2026-04-13 9:41 ` [PATCH v4 2/8] fuse: {io-uring} Rename ring->nr_queues to max_nr_queues Bernd Schubert via B4 Relay
2026-04-13 9:41 ` [PATCH v4 3/8] fuse: {io-uring} Use bitmaps to track registered queues Bernd Schubert via B4 Relay
2026-04-24 15:04 ` Luis Henriques
2026-04-24 15:33 ` Bernd Schubert
2026-04-27 8:02 ` Luis Henriques [this message]
2026-04-27 10:39 ` Bernd Schubert
2026-04-13 9:41 ` [PATCH v4 4/8] fuse: Fetch a queued fuse request on command registration Bernd Schubert via B4 Relay
2026-04-13 9:41 ` [PATCH v4 5/8] fuse: {io-uring} Allow reduced number of ring queues Bernd Schubert via B4 Relay
2026-04-24 15:15 ` Luis Henriques
2026-04-24 18:28 ` Joanne Koong
2026-04-24 22:00 ` Bernd Schubert
2026-04-13 9:41 ` [PATCH v4 6/8] fuse: {io-uring} Queue background requests on a different core Bernd Schubert via B4 Relay
2026-04-24 15:26 ` Luis Henriques
2026-04-13 9:41 ` [PATCH v4 7/8] fuse: Add retry attempts for numa local queues for load distribution Bernd Schubert via B4 Relay
2026-04-24 15:28 ` Luis Henriques
2026-04-13 9:41 ` [PATCH v4 8/8] fuse: {io-uring} Prefer the current core over mapping Bernd Schubert via B4 Relay
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=87v7dckezl.fsf@igalia.com \
--to=luis@igalia.com \
--cc=bernd@bsbernd.com \
--cc=bschubert@ddn.com \
--cc=dchg2000@gmail.com \
--cc=devnull+bernd.bsbernd.com@kernel.org \
--cc=joannelkoong@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=miklos@szeredi.hu \
/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