diff options
author | Ayush Ranjan <ayushranjan@google.com> | 2021-04-29 16:09:49 -0700 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-04-29 16:12:08 -0700 |
commit | 9ff0d382d69c53a8fc916cfde844f1e657759f59 (patch) | |
tree | 0f5372d3488bdc1b55b6d8610b6dfb27b73ac55b /pkg/state/encode.go | |
parent | eefa00f4aecc7c72a1866357fbd1bbb58aa6fc5e (diff) |
[perf] Remove unnecessary existence checks in doCreateAt().
Originally we were making a WalkGetAttrOne RPC to confirm that a file does not
exist on the remote filesystem - when there was no cached information about the
existence of a dentry at that position.
This change avoids making that RPC and speculatively makes the
mkdir/mknod/linkat/symlink RPC. They will fail with EEXIST if a file exists at
that position as we want.
However the error ordering is important. Existence check comes before
writability check. So we make the existence check when the writability check
fails and give it precedence.
This change saves ~76,000 RPCs while building //absl/... (ABSL build benchmark).
That is 10% of all RPCs made while running that workload.
PiperOrigin-RevId: 371225633
Diffstat (limited to 'pkg/state/encode.go')
0 files changed, 0 insertions, 0 deletions