Public bug reported:

This updates FUSE uncached readdir to back the temporary output buffer
with pages and set out_pages, instead of passing the buffer as a kvec
output argument.

For virtiofs, kvec output arguments are copied through req->argbuf,
which is allocated with kmalloc(..., GFP_ATOMIC). Large uncached readdir
requests can therefore require a multi-megabyte contiguous atomic
allocation before the request is queued. Using output pages lets
transports such as virtiofs pass the buffer as scatter-gather entries
instead.

The existing uncached readdir buffer sizing is unchanged. Pages are
mapped with vm_map_ram() only while parsing returned dirents.

LKML:
[PATCH v4] fuse: back uncached readdir buffers with pages - 
https://lore.kernel.org/all/[email protected]/

linux-next:
2fcb1dd15fab fuse: back uncached readdir buffers with pages

Testing

Validated the original failing configuration:

4K host page size + 64K guest page size
virtme-ng with --overlay-rwdir /tmp

Command:

getconf PAGE_SIZE
vng --run arch/arm64/boot/Image \
  --memory 16G --cpus 4 --overlay-rwdir /tmp \
  --exec 'uname -r; getconf PAGE_SIZE; ls /tmp; echo "ls rc=$?"; python3 -c 
"import os; print(len(os.listdir(\"/tmp\")))"'

Result:

host PAGE_SIZE: 4096
guest PAGE_SIZE: 65536
ls rc=0
python os.listdir("/tmp") completed successfully

This is the configuration that previously failed with Cannot allocate
memory.

** Affects: linux-nvidia (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2156632

Title:
  Backport: fuse: back uncached readdir buffers with pages

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux-nvidia/+bug/2156632/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to