diff options
author | Zhaozhong Ni <nzz@google.com> | 2018-08-28 13:20:54 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2018-08-28 13:22:07 -0700 |
commit | d724863a313f5e08a043c8f2ccb4969e8ea23de1 (patch) | |
tree | 16d082c77daa0d3384e89a9984a2569e739f0bb7 /pkg/sentry/fs/dirent.go | |
parent | ea113a4380543080f7ad92f536e71706e71d9285 (diff) |
sentry: optimize dirent weakref map save / restore.
Weak references save / restore involves multiple interface indirection
and cause material latency overhead when there are lots of dirents, each
containing a weak reference map. The nil entries in the map should also
be purged.
PiperOrigin-RevId: 210593727
Change-Id: Ied6f4c3c0726fcc53a24b983d9b3a79121b6b758
Diffstat (limited to 'pkg/sentry/fs/dirent.go')
-rw-r--r-- | pkg/sentry/fs/dirent.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/sentry/fs/dirent.go b/pkg/sentry/fs/dirent.go index 5587582b5..9417e808f 100644 --- a/pkg/sentry/fs/dirent.go +++ b/pkg/sentry/fs/dirent.go @@ -201,7 +201,7 @@ type Dirent struct { mu sync.Mutex `state:"nosave"` // children are cached via weak references. - children map[string]*refs.WeakRef + children map[string]*refs.WeakRef `state:".(map[string]*Dirent)"` } // NewDirent returns a new root Dirent, taking the caller's reference on inode. The caller |