Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sentry Virtual Filesystem v2 (VFS2) #1035

fvoznika opened this issue Oct 18, 2019 · 0 comments


Copy link

@fvoznika fvoznika commented Oct 18, 2019

Current VFS implementation in the Sentry has performance shortcomings with regarding to the number of operations that need to be performed for path walks. This is especially noticeable when using gofer mounted filesystems, where the round trip cost for each operation is aggravated by the RPC and scheduling costs.

VFS2 addresses this by delegating path resolution to the filesystem, making it possible to send a single RPC for each syscall operation, instead of one RPC per path component in the operation. For example, stat(/foo/bar/goo) generates at least 3 RPC round trips to the gofer (foo, bar, goo), while VFS2 makes only 1.

VFS2 also allows for the implementation of recursive bind mounts, which would require a major refactoring with the current implementation.

gvisor-bot added a commit that referenced this issue Oct 31, 2019
This is required to test filesystems with a non-trivial implementation of
FilesystemImpl.Release(). Propagation isn't handled yet, and umount isn't yet
plumbed out to VirtualFilesystem.UmountAt(), but otherwise the implementation
of umount is believed to be correct.

- Move entering mountTable.seq writer critical sections to callers of
  mountTable.{insert,remove}Seqed. This is required since umount(2) must ensure
  that no new references are taken on the candidate mount after checking that
  it isn't busy, which is only possible by entering a vfs.mountTable.seq writer
  critical section before the check and remaining in it until after
  VFS.umountRecursiveLocked() is complete. (Linux does the same thing:
  fs/namespace.c:do_umount() => lock_mount_hash(),
  fs/pnode.c:propagate_mount_busy(), umount_tree(), unlock_mount_hash().)

- It's not possible for dentry deletion to umount while only holding
  VFS.mountMu for reading, but it's also very unappealing to hold VFS.mountMu
  exclusively around e.g. gofer unlink RPCs. Introduce to avoid these
  problems. This means that VFS.mountMu is never acquired for reading, so
  change it to a sync.Mutex.

Updates #1035

PiperOrigin-RevId: 277607680
@fvoznika fvoznika added the area: vfs2 label Nov 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.