All of lore.kernel.org
 help / color / mirror / Atom feed
* Access cache and lookupcache=pos
@ 2021-03-02  3:45 Geert Jansen
  0 siblings, 0 replies; only message in thread
From: Geert Jansen @ 2021-03-02  3:45 UTC (permalink / raw)
  To: linux-nfs

Hi,

some of our customers run applications that require the lookupcache=pos
mount option. One example of such an application is Gitlab [1]. Recently we
profiled a Gitlab workload and noticed that 38% of compound operations and
27% of EFS server time were spent on an ACCESS compound (SEQUENCE, PUTFH,
ACCESS, GETATTR) that we weren't sure is necessary.

To reproduce:

1. Mount an NFS file system with -o lookupcache=pos.
2. $ mkdir /mnt/a
3. $ for i in `seq 1 10`; do ls /mnt/a/nonex.txt; done

There are two compounds that are emitted for every iteration in step 3:

1. SEQUENCE, PUTFH, ACCESS, GETATTR
2. SEQUENCE, PUTFH, LOOKUP, GETFH, GETATTR

In the first compound, ACCESS has FH=</mnt/a> and access=0x1f. The result is
NFS4_OK with supported=0x1f and access=1f. In the second compound, LOOKUP
has FH=</mnt/a> and objname="nonex.txt". The result is NFS4ERR_NOENT.

If I understand lookupcache=pos correctly, it causes the result of LOOKUP
not to be cached because of the ENOENT, which is what's happening. Is there
a reason that the succesful ACCESS is not cached in the parent directory's
access_cache? Caching it would reduce the runtime of this application by
about 27% which would be a nice speedup.

[1] https://docs.gitlab.com/ee/administration/nfs.html

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

only message in thread, other threads:[~2021-03-02 19:46 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-02  3:45 Access cache and lookupcache=pos Geert Jansen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.