All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Hajnoczi <stefanha@redhat.com>
To: Brian Song <hibriansong@gmail.com>
Cc: qemu-block@nongnu.org, qemu-devel@nongnu.org, hreitz@redhat.com,
	kwolf@redhat.com, eblake@redhat.com, armbru@redhat.com,
	fam@euphon.net, bernd@bsbernd.com
Subject: Re: [Patch v4 2/7] fuse: io_uring mode init
Date: Thu, 19 Feb 2026 09:42:56 -0500	[thread overview]
Message-ID: <20260219144256.GD817358@fedora> (raw)
In-Reply-To: <C001D79E-6269-4DC7-ABD3-AE86B8122909@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2249 bytes --]

On Fri, Feb 13, 2026 at 05:03:23PM +0800, Brian Song wrote:
> 
> 
> > On Feb 12, 2026, at 04:56, Stefan Hajnoczi <stefanha@redhat.com> wrote:
> > 
> > On Sat, Feb 07, 2026 at 08:08:56PM +0800, Brian Song wrote:
> >> +typedef struct FuseUringEnt {
> >> +    /* back pointer */
> >> +    FuseUringQueue *rq;
> >> +
> >> +    /* commit id of a fuse request */
> >> +    uint64_t req_commit_id;
> 
> [...]
> 
> >> +
> >> +/**
> >> + * Distribute uring queues across FUSE queues in the round-robin manner.
> >> + * This ensures even distribution of kernel uring queues across user-specified
> >> + * FUSE queues.
> >> + *
> >> + * num_uring_queues > num_fuse_queues: Each IOThread manages multiple uring
> >> + * queues (multi-queue mapping).
> >> + * num_uring_queues < num_fuse_queues: Excess IOThreads remain idle with no
> >> + * assigned uring queues.
> >> + */
> >> +static void fuse_uring_setup_queues(FuseExport *exp, size_t bufsize)
> >> +{
> >> +    int num_uring_queues = get_nprocs_conf();
> >> +
> >> +    exp->num_uring_queues = num_uring_queues;
> >> +    exp->uring_queues = g_new(FuseUringQueue, num_uring_queues);
> >> +
> >> +    for (int i = 0; i < num_uring_queues; i++) {
> >> +        FuseUringQueue *rq = &exp->uring_queues[i];
> >> +        rq->rqid = i;
> >> +        rq->ent = g_new(FuseUringEnt, exp->uring_queue_depth);
> >> +
> >> +        for (int j = 0; j < exp->uring_queue_depth; j++) {
> >> +            FuseUringEnt *ent = &rq->ent[j];
> >> +            ent->rq = rq;
> >> +            ent->req_payload_sz = bufsize - FUSE_BUFFER_HEADER_SIZE;
> >> +            ent->req_payload = g_malloc0(ent->req_payload_sz);
> > 
> > I don't see a corresponding g_free() in this patch? Exports can be
> > deleted at runtime, so this memory must be freed.
> > 
> 
> ent->req_payload is deleted in fuse_export_delete_uring() in a later patch.
> Should we merge patch 5 into this one?

Unless there is a strong reason why the free needs to be deferred to a
later, it's safer to include it in the same patch that allocates the
memory. It makes code review easier and backporting patches safer (no
chance of forgetting to backport the other patch that frees the memory).

Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2026-02-19 14:43 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-07 12:08 [PATCH v4 0/7] add fuse-over-io_uring support Brian Song
2026-02-07 12:08 ` [Patch v4 1/7] aio-posix: enable 128-byte SQEs Brian Song
2026-02-11 20:28   ` Stefan Hajnoczi
2026-02-07 12:08 ` [Patch v4 2/7] fuse: io_uring mode init Brian Song
2026-02-11 20:56   ` Stefan Hajnoczi
2026-02-13  8:40     ` Brian Song
2026-02-13  9:03     ` Brian Song
2026-02-19 14:42       ` Stefan Hajnoczi [this message]
2026-02-07 12:08 ` [Patch v4 3/7] fuse: uring support for write ops Brian Song
2026-02-11 21:08   ` Stefan Hajnoczi
2026-02-07 12:08 ` [Patch v4 4/7] fuse: refactor FUSE request handler Brian Song
2026-02-11 21:21   ` Stefan Hajnoczi
2026-02-13  8:07     ` Brian Song
2026-02-19 21:14       ` [PATCH] fuse: unify op_in for io_uring and classic FUSE Stefan Hajnoczi
2026-02-07 12:08 ` [Patch v4 5/6] fuse: safe termination for io_uring Brian Song
2026-02-11 21:52   ` Stefan Hajnoczi
2026-02-07 12:09 ` [Patch v4 6/7] fuse: add 'io-uring' option Brian Song
2026-02-09  5:24   ` Markus Armbruster
2026-02-11 22:50   ` Stefan Hajnoczi
2026-02-07 12:09 ` [Patch v4 7/7] fuse: add io_uring test support Brian Song
2026-02-11 21:53   ` Stefan Hajnoczi

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=20260219144256.GD817358@fedora \
    --to=stefanha@redhat.com \
    --cc=armbru@redhat.com \
    --cc=bernd@bsbernd.com \
    --cc=eblake@redhat.com \
    --cc=fam@euphon.net \
    --cc=hibriansong@gmail.com \
    --cc=hreitz@redhat.com \
    --cc=kwolf@redhat.com \
    --cc=qemu-block@nongnu.org \
    --cc=qemu-devel@nongnu.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.