Vast majority of vnodes are not mmaped for writing and the entire list scan is highly wasteful.
Keep a hold on the vnode to prevent it from disappearing before we managed to inspect it.
Differential D23423
tmpfs: reimplement the mtime scan to use the lazy list mjg on Jan 30 2020, 4:24 AM. Authored by Tags None Referenced Files
Subscribers
Details
Diff Detail
Event Timeline
Comment Actions BTW, why not use lazy list processing for mtime update, and remove tmpfs_update_mtime() ?
Comment Actions So the original code had: + /* + * Handle lazy updates of mtime from writes to mmaped + * regions. Use MNT_VNODE_FOREACH_ALL instead of + * MNT_VNODE_FOREACH_ACTIVE, since unmap of the + * tmpfs-backed vnode does not call vinactive(), due + * to vm object type is OBJT_SWAP. + */ In the patch the problem is combated with putting the vnode on the lazy list with an explicit hold. Should the mapping disappear, we will find it anyway and remove the extra attachment. However, the vnode may be put on the list for other reasons (in particular just being opened for writing) and consequently there needs to be a way to denote that there is an extra hold. As such, inspecting the write count is in my opinion insufficient. |