summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/vfs/opath.go
diff options
context:
space:
mode:
authorFabricio Voznika <fvoznika@google.com>2021-04-19 16:22:32 -0700
committergVisor bot <gvisor-bot@google.com>2021-04-19 16:25:01 -0700
commit276ff149a4555b69c4c99fdcd4e1a22ccc8b9463 (patch)
tree744b3618a19f16b45b4fe6bfa584dc6a9b2e00ad /pkg/sentry/vfs/opath.go
parent8ad6657a22b0eaaef7d1b4a31553e826a87e9190 (diff)
Add MultiGetAttr message to 9P
While using remote-validation, the vast majority of time spent during FS operations is re-walking the path to check for modifications and then closing the file given that in most cases it has not been modified externally. This change introduces a new 9P message called MultiGetAttr which bulks query attributes of several files in one shot. The returned attributes are then used to update cached dentries before they are walked. File attributes are updated for files that still exist. Dentries that have been deleted are removed from the cache. And negative cache entries are removed if a new file/directory was created externally. Similarly, synthetic dentries are replaced if a file/directory is created externally. The bulk update needs to be carefull not to follow symlinks, cross mount points, because the gofer doesn't know how to resolve symlinks and where mounts points are located. It also doesn't walk to the parent ("..") to avoid deadlocks. Here are the results: Workload VFS1 VFS2 Change bazel action 115s 70s 28.8s Stat/100 11,043us 7,623us 974us Updates #1638 PiperOrigin-RevId: 369325957
Diffstat (limited to 'pkg/sentry/vfs/opath.go')
-rw-r--r--pkg/sentry/vfs/opath.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/sentry/vfs/opath.go b/pkg/sentry/vfs/opath.go
index 39fbac987..47848c76b 100644
--- a/pkg/sentry/vfs/opath.go
+++ b/pkg/sentry/vfs/opath.go
@@ -121,7 +121,7 @@ func (fd *opathFD) Stat(ctx context.Context, opts StatOptions) (linux.Statx, err
Start: fd.vfsfd.vd,
})
stat, err := fd.vfsfd.vd.mount.fs.impl.StatAt(ctx, rp, opts)
- vfsObj.putResolvingPath(ctx, rp)
+ rp.Release(ctx)
return stat, err
}
@@ -134,6 +134,6 @@ func (fd *opathFD) StatFS(ctx context.Context) (linux.Statfs, error) {
Start: fd.vfsfd.vd,
})
statfs, err := fd.vfsfd.vd.mount.fs.impl.StatFSAt(ctx, rp)
- vfsObj.putResolvingPath(ctx, rp)
+ rp.Release(ctx)
return statfs, err
}