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)
Thu, Apr 4, 11:52 AM
Unknown Object (File)
Feb 21 2024, 4:13 PM
Unknown Object (File)
Jan 12 2024, 10:45 PM
Unknown Object (File)
Dec 20 2023, 5:13 AM
Unknown Object (File)
Dec 11 2023, 9:10 PM
Unknown Object (File)
Nov 14 2023, 3:46 PM
Unknown Object (File)
Sep 28 2023, 5:11 AM
Unknown Object (File)
Sep 20 2023, 9:18 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