Files
seaweedfs/weed/mount
Chris LuandGitHub 75ae33ade8 mount: let the kernel cache directory listings (#10634)
Every enumeration of a directory walked the whole FUSE machinery, so
reopening a folder cost what opening it did. The kernel has a cache for
exactly this: with FOPEN_CACHE_DIR the listing lives in the directory's
page cache and a repeat enumeration never reaches the mount at all.

Local mutations already drop that cache in the kernel. Remote ones
arrive through the metadata subscription, so the entry invalidation
worker now also tells the kernel which directory changed. The worker is
the one place this is safe from: notifying from a thread serving a
kernel request can deadlock against the page it holds, which is why the
file paths deliberately avoid InodeNotify.

Measured in a Linux container, 20k-entry directory, ls repeated:

    warm listing   before 199-355ms   after 6-9ms

A file written from outside the mount appeared in the next listing
within a second, through the subscription notify, and the listing
re-cached after.

The memory is the kernel's page cache: reclaimed under pressure, owned
per-directory, and covering read-through directories the mount-side
caches never see.
2026-08-07 17:48:42 -07:00
..
2026-02-20 18:42:00 -08:00