sapling/eden/fs
Wez Furlong d780d3813a eden: fix fuse attribute TTLs on macos
Summary:
We noticed that some operations were surprisingly slow and
the hypothesis was that caching in the kext wasn't working well.

I traced into this with a simple repeated `realpath` of the same file
while running the server with debug logging turned up.  That showed
that we were getting two requests from the kernel for each inode in
the path resolution for each invocation of the realpath tool.

I switched to looking at the kext code and found this section to be
a potential issue:

https://github.com/osxfuse/kext/blob/support/osxfuse-3/osxfuse/fuse_internal.h#L711

```
        /* XXX: truncation; user space sends us a 64-bit tv_sec */ \
        VTOFUD(vp)->attr_valid.tv_sec = (time_t)struct_name ## _get_attr_valid(fuse_out); \
        VTOFUD(vp)->attr_valid.tv_nsec = struct_name ## _get_attr_valid_nsec(fuse_out); \
        nanouptime(&uptsp_ ## __funct__); \
```

Switching our default TTL to be the maximum possible value that fits
in a signed 32-bit time_t cuts down on the requests from the kernel to
a single lookup for the symlink:

```
V1105 15:56:28.900839 28132386 FuseChannel.cpp:1141] fuse request opcode=1 FUSE_LOOKUP unique=2 len=47 nodeid=14910747 uid=2048904527 gid=1876110778 pid=24546
V1105 15:56:28.900885 28132386 FuseChannel.cpp:1437] FUSE_LOOKUP parent=14910747 name=README
V1105 15:56:28.901111 28143988 FuseChannel.cpp:421] sendRawReply: unique=2 header->len=160 wrote=160
```

and no requests at all for a plain file in the repo.

Reviewed By: simpkins

Differential Revision: D18340767

fbshipit-source-id: caebf051a543c54f7a03852fd2e0abab68448ded
2019-11-05 18:28:06 -08:00
..
benchharness Tidy up license headers 2019-10-11 05:28:23 -07:00
config rename hg:use-datapack so old code doesn't get enabled 2019-10-31 16:34:19 -07:00
fuse eden: fix fuse attribute TTLs on macos 2019-11-05 18:28:06 -08:00
inodes add a new getScmStatusV2() API to replace getScmStatus() 2019-10-29 09:56:31 -07:00
journal rename tracing to telemetry 2019-10-15 13:39:41 -07:00
model Remove dead includes in eden 2019-10-11 16:45:01 -07:00
rocksdb Remove dead includes in eden 2019-10-11 16:45:01 -07:00
service add a new getScmStatusV2() API to replace getScmStatus() 2019-10-29 09:56:31 -07:00
sqlite Tidy up license headers 2019-10-11 05:28:23 -07:00
store eden: fixup build after useDatapack -> useHgCache change 2019-11-01 08:10:03 -07:00
takeover clang-format 2019-10-24 14:56:43 -07:00
telemetry introduce a StructuredLogger 2019-10-25 19:29:01 -07:00
testharness save version number in EdenServer 2019-10-24 12:48:33 -07:00
utils warn on unused exception parameter 2019-10-28 17:49:23 -07:00
win Throw EdenError when it's not implemented. 2019-10-30 10:50:02 -07:00
CMakeLists.txt rename tracing to telemetry 2019-10-15 13:39:41 -07:00