Lazily write inode timestamps to FUSE
Before this, the FUSE daemon receives a setattr inode timestamp
request for every write request. This can be crippling for write
performance or read performance during writes especially random
writes where the write back cache does not effectively coagulate
requests.
We now add the MS_LAZYTIME mount flag
(http://man7.org/linux/man-pages/man2/mount.2.html) to lazily flush
the timestamp updates from memory to disk
Test: m
Bug: 135341433
Change-Id: I95a467d5682a325b4099f32634d93ed2921f815e
diff --git a/Utils.cpp b/Utils.cpp
index 5e284b2..e5bf33d 100644
--- a/Utils.cpp
+++ b/Utils.cpp
@@ -1023,7 +1023,8 @@
const int result_int =
TEMP_FAILURE_RETRY(mount("/dev/fuse", path.c_str(), "fuse",
- MS_NOSUID | MS_NODEV | MS_NOEXEC | MS_NOATIME, opts.c_str()));
+ MS_NOSUID | MS_NODEV | MS_NOEXEC | MS_NOATIME | MS_LAZYTIME,
+ opts.c_str()));
if (result_int != 0) {
PLOG(ERROR) << "Failed to mount " << path;
return -errno;