The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* Re: [PATCH v2] fuse: back uncached readdir buffers with pages
       [not found]   ` <D14CFB43-C7D8-4F3E-920B-E2A3B925E6B3@nvidia.com>
@ 2026-05-14 21:35     ` Matt Ochs
  0 siblings, 0 replies; only message in thread
From: Matt Ochs @ 2026-05-14 21:35 UTC (permalink / raw)
  To: Miklos Szeredi
  Cc: Bernd Schubert, linux-fsdevel@vger.kernel.org,
	linux-kernel@vger.kernel.org

Hi Miklos,

> On Apr 30, 2026, at 14:24, Matt Ochs <mochs@nvidia.com> wrote:
> 
>> 
>> On Apr 29, 2026, at 02:27, Miklos Szeredi <miklos@szeredi.hu> wrote:
>> 
>> On Wed, 29 Apr 2026 at 01:30, Matthew R. Ochs <mochs@nvidia.com> wrote:
>> 
>>> The larger buffer is also 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 readdir buffer can
>>> therefore require a multi-megabyte contiguous atomic allocation and fail
>>> with -ENOMEM.
>> 
>> Shouldn't this be max_read?  Here "read" and "write" refer to
>> direction of I/O on the filesystem, not on the fuse device (see
>> fuse/file.c)
> 
> Thanks, the read/write direction point makes sense.
> 
> I tested changing the cap to fc->max_read only, but that reproduces the
> original virtiofs failure on the 4K-host/64K-guest setup. The runtime
> values for the failing READDIR are:
> 
> PAGE_SIZE=65536
> fc->max_pages=124
> fc->max_read=4294967295
> fc->max_write=1048576
> max_bufsize=8126464
> nr_pages=124
> 
> So for this virtiofs mount, fc->max_read is effectively unlimited, while
> virtiofsd advertises its 1 MiB MAX_BUFFER_SIZE through max_write and
> rejects READDIR sizes above that limit.
> 
> Do you prefer handling this locally in fuse_readdir_uncached(), for
> example by capping the request with all available limits:
> 
> min3_t(size_t, fc->max_pages << PAGE_SHIFT, fc->max_read, fc->max_write)
> 
> Or should virtiofs/FUSE instead make fc->max_read reflect this byte-sized
> buffer limit before readdir uses it?
> 
> I will address the other cleanup comments in v3: drop the cast, keep the
> clamp-style sizing, use release_pages(), and remove the nomem double jump.
> 

Checking in if you have a preference on how this is handled?


-matt

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-05-14 21:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20260428233028.2747981-1-mochs@nvidia.com>
     [not found] ` <CAJfpegtcsWnXh-uDh1Qu83dFF9nJji1gytk2y9Wk5p9+JDTZ+w@mail.gmail.com>
     [not found]   ` <D14CFB43-C7D8-4F3E-920B-E2A3B925E6B3@nvidia.com>
2026-05-14 21:35     ` [PATCH v2] fuse: back uncached readdir buffers with pages Matt Ochs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox