sapling/eden/fs/fuse
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
..
fuse_tester rename tracing to telemetry 2019-10-15 13:39:41 -07:00
privhelper warn on unused exception parameter 2019-10-28 17:49:23 -07:00
test rename tracing to telemetry 2019-10-15 13:39:41 -07:00
BufVec.cpp Tidy up license headers 2019-10-11 05:28:23 -07:00
BufVec.h Tidy up license headers 2019-10-11 05:28:23 -07:00
CMakeLists.txt use fb303 repo in open source build 2019-07-24 21:07:04 -07:00
DirList.cpp Tidy up license headers 2019-10-11 05:28:23 -07:00
DirList.h Tidy up license headers 2019-10-11 05:28:23 -07:00
Dispatcher.cpp remove the dead FileHandle class 2019-10-18 12:17:43 -07:00
Dispatcher.h eden: fix fuse attribute TTLs on macos 2019-11-05 18:28:06 -08:00
FuseChannel.cpp remove the dead FileHandle class 2019-10-18 12:17:43 -07:00
FuseChannel.h Tidy up license headers 2019-10-11 05:28:23 -07:00
FuseTypes.h Tidy up license headers 2019-10-11 05:28:23 -07:00
InodeNumber.cpp Tidy up license headers 2019-10-11 05:28:23 -07:00
InodeNumber.h Tidy up license headers 2019-10-11 05:28:23 -07:00
PollHandle.cpp Tidy up license headers 2019-10-11 05:28:23 -07:00
PollHandle.h Tidy up license headers 2019-10-11 05:28:23 -07:00
RequestData.cpp Tidy up license headers 2019-10-11 05:28:23 -07:00
RequestData.h rename tracing to telemetry 2019-10-15 13:39:41 -07:00