Split TMPFS_NODE_ACCCESSED bit into dedicated byte that can be updated atomically without locks or (locked) atomics.
tn_update_getattr() change also contains unrelated bug fix.
Reported by: lwhsu
PR: 249362
(Not tested).
Differential D26451
tmpfs: restore atime updates for reads from page cache. kib on Sep 16 2020, 12:54 PM. Authored by Tags None Referenced Files
Subscribers
Details Split TMPFS_NODE_ACCCESSED bit into dedicated byte that can be updated atomically without locks or (locked) atomics. tn_update_getattr() change also contains unrelated bug fix. Reported by: lwhsu (Not tested).
Diff Detail
Event TimelineComment Actions The tmpfs_set_accessed call in pgread has to move up prior to vfs_smr_exit. I can't make an inline comment for some reason. On a more general note perhaps this can finally move to just getnanotime() on access and updating the stored value only if it goes forward. While this would incur some loss of concurrency it may be small enough to be more than tolerable, all while finally providing reasonable timestamp accuracy. Note as it is atime is updated who-knows-when. Same goes for other counters. Comment Actions Done.
At least we do not write torn values to Xtime fields. I do not want to take node lock in tmpfs_pgcache_read(), after all efforts I put to remove object and node referencing. Comment Actions But we don't have to have torn writes or any locking. The most aggressive take on it would just store the 4 byte ticks and make sure something eventually takes care of it before a potential wrap around. The general problem is that atime updates from reads on all filesystems is drastically inaccurate - timestamp is updated many seconds later. That said, fixing even if only for tmpfs may be beyond the scope of this patch.
Comment Actions Storing timecounter raw value means that we need to do active scan each second.
Comment Actions Add comment about tn_accessed. |