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>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: Re: [PATCH v3] fuse: back uncached readdir buffers with pages
Date: Tue, 19 May 2026 15:34:11 +0000	[thread overview]
Message-ID: <F3BA075C-8E63-4077-B701-63269703155E@nvidia.com> (raw)
In-Reply-To: <CAJfpegsTsKqq+QQKyBexQFP1=EGd8YiMT=rbaCOPeTBvLsY_JQ@mail.gmail.com>

> On May 19, 2026, at 05:04, Miklos Szeredi <miklos@szeredi.hu> wrote:
> 
> On Tue, 19 May 2026 at 02:47, Matthew R. Ochs <mochs@nvidia.com> wrote:
> 
>> This was observed with a 64K-page guest on a 4K-page host, using an
>> overlayfs mount whose lower directory is on virtiofs. Reading a merged
>> directory through overlayfs failed with:
>> 
>>  ls: reading directory '<path>': Cannot allocate memory
> 
> IDGI, the patch makes FUSE_READDIR supply an array of folios.
> Virtiofs shouldn't need to allocate a large argbuf after that.
> 
> What am I missing?

You're right. After switching READDIR to out_pages, the large READDIR
reply payload should no longer be copied through req->argbuf. My commit
message conflated that with the separate request-size issue.

What I saw while testing the page-backed version was that the READDIR
size was still derived from fc->max_pages using the guest PAGE_SIZE. On
the failing 4K host / 64K guest setup that produced:

  PAGE_SIZE=65536 max_pages=124 max_read=UINT_MAX max_write=1048576
  bufsize=8126464 nr_pages=124

With out_pages but without the byte-size cap, fuse_simple_request()
still returned -ENOMEM. Capping the request to 1048576 bytes / 16 pages
made the same test pass.

So the out_pages change fixes the large reply-payload argbuf problem.
The fc->max_read/fc->max_write cap is addressing the separate issue that
fc->max_pages is only a page-count limit and can translate to an
oversized READDIR byte count when the client PAGE_SIZE differs.

I can rework the commit message to make that distinction clear.


-matt

  reply	other threads:[~2026-05-19 15:34 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-19  0:47 Matthew R. Ochs
2026-05-19 10:04 ` Miklos Szeredi
2026-05-19 15:34   ` Matt Ochs [this message]
2026-05-19 15:41     ` Miklos Szeredi
2026-05-22  1:32       ` Matt Ochs
2026-06-10 12:22         ` Miklos Szeredi

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=F3BA075C-8E63-4077-B701-63269703155E@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 \
    --cc=stable@vger.kernel.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 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®