2 Commits

Author SHA1 Message Date
Andrei Vagin 5f4abad306 Fix a few typos
It is an idea of running codespell as part of our presubmit checks.
Before enabling it for new changes, let's fix what it has found.

Signed-off-by: Andrei Vagin <avagin@gmail.com>
2023-10-25 12:13:42 -07:00
Ayush Ranjan 575a6f5003 Introduce filesystem tree nodes to lisafs.
This is very similar to p9 in design and helps address all the discussed
security concerns around the old lisafs design.

In p9, the path tree grows unbounded. Once a path is walked, those path nodes
exist for the lifetime of the server. That hurts memory performance and usage.
Additionally, nodes are allocated separately from FidRefs which are allocated
separately from Files. Each path node also has 3 hashmaps tracking various
things. This leads to a LOT of allocations.

In lisafs, we cut down almost all the additional allocations. Nodes have a
bounded lifetime. Once all refs on node are dropped, the node is removed from
the filesystem tree. In the overwhelming common case, where the client is not
compromised and is behaving correctly (gofer client in sentry), the lifecycle
of the ControlFD and Node are equivalent. So lisafs allocates them together.

lisafs also only uses 1 hashmap in each node to track children. This too has
been optimized. Experimentation showed that majority of directories have at
most 3 children to track. So we only allocate the hashmap once we hit 4
children. Before that, we statically track 3 children using hardcoded pointers.

Tested: All 221 syscall tests pass with lisafs.
PiperOrigin-RevId: 424933787
2022-01-28 12:41:25 -08:00