Page MenuHomeFreeBSD

3/3 vfs: allow v_holdcnt to transition 0->1 without the interlock
ClosedPublic

Authored by mjg on Jan 15 2020, 3:03 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Jan 17, 10:32 PM
Unknown Object (File)
Sat, Jan 11, 4:03 PM
Unknown Object (File)
Fri, Jan 10, 6:38 PM
Unknown Object (File)
Dec 10 2024, 4:37 PM
Unknown Object (File)
Dec 5 2024, 6:44 PM
Unknown Object (File)
Nov 23 2024, 2:26 AM
Unknown Object (File)
Nov 20 2024, 6:01 AM
Unknown Object (File)
Sep 24 2024, 8:22 AM
Subscribers

Details

Summary

Similarly to use count, we only care about vget and vref for which the contract has not changed. Since r356672 vnode activation only requires freevnodes update which we can accomodate without the interlock.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

sys/kern/vfs_subr.c
3354 ↗(On Diff #66765)

This requires a little longer comment. I think I understand it but it would be nice to have a little more language around it.

sys/kern/vfs_subr.c
3354 ↗(On Diff #66765)

How about this:

By the time we get here another thread might have called vhold and we have no way of knowing if it was followed by vlazy. Unlinking from the list would be a bug if it was and letting it stay is harmless in either case. Thus don't do anything if someone is using the vnode.

sys/kern/vfs_subr.c
3354 ↗(On Diff #66765)

"Don't remove the vnode from the lazy list if another thread has increased the hold count. It may have re-enqueued the vnode to the lazy list and is now responsible for its removal"

  • rebase on top of D23235
  • fix a typo in assert
  • expand the comment about vhold race
This revision is now accepted and ready to land.Jan 18 2020, 2:58 PM