On Fri, 25 Oct 2024 at 03:38, Jingbo Xu <jefflexu@xxxxxxxxxxxxxxxxx> wrote: > Actually as for FUSE, IIUC the writeback is not guaranteed to be > completed when sync(2) returns since the temp page mechanism. When > sync(2) returns, PG_writeback is indeed cleared for all original pages > (in the address_space), while the real writeback work (initiated from > temp page) may be still in progress. Correct, this is the current behavior of fuse. I'm not against changing this for the privileged server case. I.e. a server running with certain privileges (e.g. CAP_SYS_ADMIN in the global namespace) then it should be able to opt in to waiting sync(2) behavior. > I think this is also what Miklos means in: > https://lore.kernel.org/all/CAJfpegsJKD4YT5R5qfXXE=hyqKvhpTRbD4m1wsYNbGB6k4rC2A@xxxxxxxxxxxxxx/ > > Though we need special handling for AS_NO_WRITEBACK_RECLAIM marked pages > in sync(2) codepath similar to what we have done for the direct reclaim > in patch 1. I'd love to get rid of the tmp page thing completely if the same guarantees can be implemented in the mm. Thanks, Miklos