Page MenuHomeFreeBSD

ufs: try to elide the interlock in ufs_itimes
ClosedPublic

Authored by mjg on Sep 10 2022, 9:33 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jul 1, 5:30 AM
Unknown Object (File)
Mon, Jun 30, 10:07 PM
Unknown Object (File)
Mon, Jun 30, 3:56 PM
Unknown Object (File)
Mon, Jun 30, 1:18 PM
Unknown Object (File)
Sat, Jun 28, 12:31 PM
Unknown Object (File)
Fri, Jun 27, 8:20 PM
Unknown Object (File)
Thu, Jun 26, 7:25 PM
Unknown Object (File)
Sat, Jun 21, 1:57 AM
Subscribers

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

mjg requested review of this revision.Sep 10 2022, 9:33 PM
mjg created this revision.

Then why checking for v_usecount > 1 at all? It can go to 1 at any time.

I'm guessing the original code was avoiding the call, expecting for it to happen in ufs_inactive later. This retains the ultimately racy nature, except avoids the interlock.

I agree, it probably was an attempt for micro-optimization, I do not see any other reason. Then, since inactivation is not guaranteed to occur now, while close is, I think the check for v_usecount should be removed.

mjg retitled this revision from ufs: do a lockless usecount check in ufs_close to ufs: try to elide the interlock in ufs_itimes.
mjg edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Sep 13 2022, 10:17 AM

With updates, looks good.

This revision was automatically updated to reflect the committed changes.