Skip to content

fuse: update atime locally and flush it via SETATTR - #190

Open
ukernel wants to merge 1 commit into
redfs-ubuntu-noble-6.8.0-58.60from
fuse-atime
Open

fuse: update atime locally and flush it via SETATTR#190
ukernel wants to merge 1 commit into
redfs-ubuntu-noble-6.8.0-58.60from
fuse-atime

Conversation

@ukernel

@ukernel ukernel commented Jul 20, 2026

Copy link
Copy Markdown

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.

@ukernel
ukernel force-pushed the fuse-atime branch 2 times, most recently from d3d0f42 to 5d81fbf Compare July 20, 2026 15:54
Comment thread fs/fuse/dir.c Outdated
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 bsbernd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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.

@ukernel

ukernel commented Aug 11, 2026

Copy link
Copy Markdown
Author

@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.

@ukernel

ukernel commented Aug 11, 2026

Copy link
Copy Markdown
Author

@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.

@bsbernd

bsbernd commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

@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.

@ukernel

ukernel commented Aug 20, 2026

Copy link
Copy Markdown
Author

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants