summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/fsimpl/gofer/gofer.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2021-04-20 20:50:20 +0000
committergVisor bot <gvisor-bot@google.com>2021-04-20 20:50:20 +0000
commit03fd0836497d44a69439b8114eb2663ebf782040 (patch)
tree023de176e89f65b4027e95ec73ecede2ce2da43b /pkg/sentry/fsimpl/gofer/gofer.go
parenta77fdfdc8c5cdce9840a758cd787f86ee4da0ee1 (diff)
parent07a78ecb2918905af030a8cf81ee86ddd1c622c5 (diff)
Merge release-20210412.0-40-g07a78ecb2 (automated)
Diffstat (limited to 'pkg/sentry/fsimpl/gofer/gofer.go')
-rw-r--r--pkg/sentry/fsimpl/gofer/gofer.go9
1 files changed, 7 insertions, 2 deletions
diff --git a/pkg/sentry/fsimpl/gofer/gofer.go b/pkg/sentry/fsimpl/gofer/gofer.go
index f491aa641..21692d2ac 100644
--- a/pkg/sentry/fsimpl/gofer/gofer.go
+++ b/pkg/sentry/fsimpl/gofer/gofer.go
@@ -1412,8 +1412,13 @@ func (d *dentry) OnZeroWatches(ctx context.Context) {
d.checkCachingLocked(ctx, false /* renameMuWriteLocked */)
}
-// checkCachingLocked should be called after d's reference count becomes 0 or it
-// becomes disowned.
+// checkCachingLocked should be called after d's reference count becomes 0 or
+// it becomes disowned.
+//
+// For performance, checkCachingLocked can also be called after d's reference
+// count becomes non-zero, so that d can be removed from the LRU cache. This
+// may help in reducing the size of the cache and hence reduce evictions. Note
+// that this is not necessary for correctness.
//
// It may be called on a destroyed dentry. For example,
// renameMu[R]UnlockAndCheckCaching may call checkCachingLocked multiple times