fuse: update atime locally and flush it via SETATTR - #190
Conversation
d3d0f42 to
5d81fbf
Compare
Make fuse track kernel atime update and flush it back to the daemon via SETATTR. Dirty atime and ctime/mtime are tracked in the inode state, marked by inode's update_time() operation. SETATTR initiated by fuse_flush_times() only updates the timestamps that were dirty. Signed-off-by: "Yan, Zheng" <ukernel@gmail.com>
bsbernd
left a comment
There was a problem hiding this comment.
@ukernel why is this needed? The commit message should explain what is the issue. without that. Right now it ony explains what the code does.
Updating time stamps should only matter for write-back mode and mtime,atime already works without this change, imho.
Adding in atime updates on plain read will introduce lots of setattr rpcs - lazy-atime is there used almost everywhere - which is what fuse already does. Just imagine an 8000 node cluster that does atime update on every read from cache.
Exactly all these explanations are missing.
|
@bsbernd Upstream fuse kernel does not support any kind of atime. It unconditional set S_NOATIME for all new inodes. This PR is adding generic "atime update on read" support. The atime update policy can be atime/relatime/lazyatime, selected by atime mount option. |
|
@bsbernd Upstream fuse kernel does not support any kind of atime. It unconditional set S_NOATIME for all new inodes. Without kernel support, we can make fuse daemon update atime on read. But it's not compatible with page cache and writeback cache. This PR is for RED-43046 (add relatime support), it adds generic "atime update on read" support. The atime update policy can be atime/relatime/lazyatime, selected by mount option. |
|
@ukernel except for cache access this still doesn't make much sense to me, as the same can be achieved when data is accessed on the red server - and that is exactly the reason why fuse isn't implementing these atime updates. |
|
@bsbernd I tried implementing atime update at server. But there is a deadlock when doing in-band atime update. (read_page -> folio lock -> server acquires sattr lock -> client invalidate sattr -> invalidate page cache -> take folio lock again). So we need to do out-band atime update inside redfsd. |
Make fuse track kernel atime update and flush it back to the daemon via SETATTR. Dirty atime and ctime/mtime are tracked in the inode state, marked by inode's update_time() operation. SETATTR initiated by fuse_flush_times() only updates the timestamps that were dirty.