From aeb87efb1ffe2ed425965e2c8e3bbd2bf80947dc Mon Sep 17 00:00:00 2001 From: Zim Date: Thu, 26 Sep 2019 16:06:05 +0100 Subject: [PATCH] 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 --- Utils.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Utils.cpp b/Utils.cpp index 5e284b2..e5bf33d 100644 --- a/Utils.cpp +++ b/Utils.cpp @@ -1023,7 +1023,8 @@ int MountUserFuse(userid_t user_id, const std::string& relative_path, 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;