Skip to content

Overlayfs file handle decode optimization

Amir Goldstein linux-unionfs 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest3 patches 4 repliesIn review
  2. v14 patches 0 repliesSuperseded

Changes in v2 from the cover letter

- Discard hash inodes by file handle
- Lookup in inode cache before lookup in index dir
- Lookup underlying fs inode cache without reconnect lower dir

[1] https://github.com/amir73il/linux/commits/ovl-nfs-export

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3ovl: disambiguate ovl_encode_fh()fs/overlayfs/copy_up.c fs/overlayfs/export.c fs/overlayfs/namei.c +1 more+16 -160 replies
2/3ovl: do not try to reconnect a disconnected origin dentryfs/exportfs/expfs.c fs/overlayfs/export.c fs/overlayfs/namei.c +1 more+23 -110 replies
3/3ovl: lookup in inode cache first when decoding lower file handlefs/overlayfs/export.c+33 -254 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [PATCH v2 0/3] Overlayfs file handle decode optimization

Miklos,

This is the 2nd revision of patch set to optimize file handle decode. It is available on branch ovl-nfs-export on my github [1].

Patch 2 introduces a semantic change to exportfs_decode_fh() to allow callers to opt-out of reconnecting the dentry. I like this minimal semantic chance, but if you think I should factor-out a "_noreconnect" variant of exportfs_decode_fh(), I can do that. Also, in ovl_lower_fh_to_d(), if we get a disconnected directory dentry and we end up needing a connected dentry, we drop the reference to the disconnected dentry and call exportfs_decode_fh() again without opting-out of reconnect. I could also export exportfs_reconnect_path() for that case, but seems unnecessary to do that as the disconnected dentry will likely still be in cache anyway.

To verify optimization, I ran all the overlay/exportfs tests with trace prints in index lookup and reconnect functions to verify that reconnect is not called when decoding a lower dir file handle of a deleted dir. Detailed analysis on this test results are in commit message of the last patch.

Thanks,
Amir.

Changes since v1:
- Discard hash inodes by file handle
- Lookup in inode cache before lookup in index dir
- Lookup underlying fs inode cache without reconnect lower dir

[1] https://github.com/amir73il/linux/commits/ovl-nfs-export

Amir Goldstein (3):
ovl: disambiguate ovl_encode_fh()
ovl: do not try to reconnect a disconnected origin dentry
ovl: lookup in inode cache first when decoding lower file handle

 fs/exportfs/expfs.c      |  9 +++++++
 fs/overlayfs/copy_up.c   |  6 ++---
 fs/overlayfs/export.c    | 70 +++++++++++++++++++++++++++---------------------
 fs/overlayfs/namei.c     | 20 +++++++-------
 fs/overlayfs/overlayfs.h |  7 ++---
 5 files changed, 66 insertions(+), 46 deletions(-)
Signature · 1 line
2.7.4