mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Matt Ochs <mochs@nvidia.com>
To: Miklos Szeredi <miklos@szeredi.hu>
Cc: Bernd Schubert <bschubert@ddn.com>,
	"linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4] fuse: back uncached readdir buffers with pages
Date: Thu, 11 Jun 2026 15:05:43 +0000	[thread overview]
Message-ID: <EEAF9BE7-AE2F-47BE-9873-E649F0A151A2@nvidia.com> (raw)
In-Reply-To: <CAJfpegvSrDgTajqWxkgRCkwxNoR6f4NU9cvKvcpThVDX-jmh-w@mail.gmail.com>

> On Jun 11, 2026, at 08:16, Miklos Szeredi <miklos@szeredi.hu> wrote:
> On Tue, 26 May 2026 at 17:20, Matthew R. Ochs <mochs@nvidia.com> wrote:
>> 
>> Commit dabb90391028 ("fuse: increase readdir buffer size") changed
>> fuse_readdir_uncached() to size its temporary buffer from ctx->count.
>> This is useful for overlayfs and other in-kernel callers that use
>> INT_MAX to indicate an unlimited directory read.
>> 
>> The larger buffer is currently supplied as a kvec output argument. For
>> virtiofs, kvec arguments are copied through req->argbuf, which is
>> allocated with kmalloc(..., GFP_ATOMIC). A large uncached readdir buffer
>> can therefore require a multi-megabyte contiguous atomic allocation
>> before the request is queued.
>> 
>> Avoid the large bounce-buffer allocation by backing uncached readdir
>> output with pages and setting out_pages. Transports such as virtiofs can
>> then pass the pages as scatter-gather entries instead of copying the
>> output through argbuf.
>> 
>> Map the pages with vm_map_ram() only while parsing the returned dirents.
>> The existing parser can then continue to use a linear kernel mapping.
>> 
>> Fixes: dabb90391028 ("fuse: increase readdir buffer size")
>> Cc: stable@vger.kernel.org
>> Signed-off-by: Matthew R. Ochs <mochs@nvidia.com>
> 
> Applied with cleanups.  Please verify:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse.git/commit/?h=for-next&id=2fcb1dd15faba5657b825cc5d54423251c70e79a

Thanks Miklos.

I have verified this patch.


-matt


      reply	other threads:[~2026-06-11 15:05 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-26 15:20 Matthew R. Ochs
2026-06-02 14:44 ` Matt Ochs
2026-06-11 13:16 ` Miklos Szeredi
2026-06-11 15:05   ` Matt Ochs [this message]

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=EEAF9BE7-AE2F-47BE-9873-E649F0A151A2@nvidia.com \
    --to=mochs@nvidia.com \
    --cc=bschubert@ddn.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@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

all inboxes | Powered by JetHome®