gvisor icon indicating copy to clipboard operation
gvisor copied to clipboard

Make syncableDentries and specialFileFDs linked lists in gofer client.

Open copybara-service[bot] opened this issue 2 years ago • 0 comments

Make syncableDentries and specialFileFDs linked lists in gofer client.

fs.syncableDentries saves all non-synthetic dentries. This requires a map insert operation every time a new dentry is created and map removal operation when a dentry is destroyed. This can be expensive there can be a very large number of non-synthetic dentries.

Using a map does not provide any additional benefits. We do not require lookup. Instead use a linked list, as insert and remove are really fast and it allows us to iterate on the list. It also saves the heap allocations to maintain the map.

Also simplify pkg/state to not use a custom ElementMapper. There is no need to.

copybara-service[bot] avatar Sep 19 '22 18:09 copybara-service[bot]