From: Horst Birthelmer <horst@birthelmer.de>
To: Joanne Koong <joannelkoong@gmail.com>
Cc: Horst Birthelmer <hbirthelmer@googlemail.com>,
Miklos Szeredi <miklos@szeredi.hu>,
Bernd Schubert <bschubert@ddn.com>,
linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
Horst Birthelmer <hbirthelmer@ddn.com>,
syzbot@syzkaller.appspotmail.com
Subject: Re: Re: [PATCH RFC v2 1/2] fuse: add compound command to combine multiple requests
Date: Wed, 7 Jan 2026 15:03:45 +0100 [thread overview]
Message-ID: <aV5l5OxMuyYs8mzQ@fedora.fritz.box> (raw)
In-Reply-To: <CAJnrk1b-7zqqDG+vROx=eALGkrM3oU-KDx1zHZtj=F5zP+oaLQ@mail.gmail.com>
On Tue, Jan 06, 2026 at 05:40:52PM -0800, Joanne Koong wrote:
> On Tue, Dec 23, 2025 at 2:13 PM Horst Birthelmer
> <hbirthelmer@googlemail.com> wrote:
> >
> > For a FUSE_COMPOUND we add a header that contains information
> > about how many commands there are in the compound and about the
> > size of the expected result. This will make the interpretation
> > in libfuse easier, since we can preallocate the whole result.
> > Then we append the requests that belong to this compound.
> >
> > The API for the compound command has:
> > fuse_compound_alloc()
> > fuse_compound_add()
> > fuse_compound_request()
> > fuse_compound_free()
> >
...
> > +
> > + if (compound->buffer_pos + needed_size > compound->buffer_size) {
> > + size_t new_size = max(compound->buffer_size * 2,
> > + compound->buffer_pos + needed_size);
> > + char *new_buffer;
> > +
> > + new_size = round_up(new_size, PAGE_SIZE);
> > + new_buffer = kvrealloc(compound->buffer, new_size,
> > + GFP_KERNEL);
> > + if (!new_buffer)
> > + return -ENOMEM;
> > + compound->buffer = new_buffer;
> > + compound->buffer_size = new_size;
>
> Hmm... when we're setting up a compound request, we already know the
> size that will be needed to hold all the requests, right? Do you think
> it makes sense to allocate that from the get-go in
> fuse_compound_alloc() and then not have to do any buffer reallocation?
> I think that also gets rid of fuse_compound_req->total_size, as that
> would just be the same as fuse_compound_req->buffer_size.
>
After looking at this again, I realized it would be more efficient to not do any allocation
in fuse_compound_alloc() at all except for the fuse_compound_req, of course, and then
do all the work in fuse_compound_send().
We keep pointers to the fuse_args given to the compound command anyway since we need
to fill out the result, so why not keep just the fuse args and don't copy anything
except when actually sending it out?
I will test this version a bit and make a simplified v3.
...
>
> Thanks,
> Joanne
Thanks,
Horst
next prev parent reply other threads:[~2026-01-07 14:03 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-23 22:13 [PATCH RFC v2 0/2] fuse: compound commands Horst Birthelmer
2025-12-23 22:13 ` [PATCH RFC v2 1/2] fuse: add compound command to combine multiple requests Horst Birthelmer
2026-01-07 1:40 ` Joanne Koong
2026-01-07 9:29 ` Horst Birthelmer
2026-01-08 1:41 ` Joanne Koong
2026-01-07 14:03 ` Horst Birthelmer [this message]
2026-01-08 1:42 ` Joanne Koong
2025-12-23 22:13 ` [PATCH RFC v2 2/2] fuse: add an implementation of open+getattr Horst Birthelmer
2026-01-07 1:46 ` Joanne Koong
2026-01-07 9:03 ` Horst Birthelmer
2025-12-29 6:03 ` [PATCH RFC v2 0/2] fuse: compound commands Jingbo Xu
2025-12-29 12:27 ` Bernd Schubert
2025-12-30 8:36 ` Horst Birthelmer
2025-12-30 11:58 ` Jingbo Xu
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=aV5l5OxMuyYs8mzQ@fedora.fritz.box \
--to=horst@birthelmer.de \
--cc=bschubert@ddn.com \
--cc=hbirthelmer@ddn.com \
--cc=hbirthelmer@googlemail.com \
--cc=joannelkoong@gmail.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miklos@szeredi.hu \
--cc=syzbot@syzkaller.appspotmail.com \
/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
all inboxes | Powered by JetHome®