Page MenuHomeFreeBSD

vfs: remove production kernel checks and mp == NULL support from vdrop
ClosedPublic

Authored by mjg on Dec 7 2019, 1:58 PM.
Tags
None
Referenced Files
Unknown Object (File)
Feb 9 2024, 3:45 PM
Unknown Object (File)
Jan 13 2024, 6:00 AM
Unknown Object (File)
Jan 1 2024, 10:26 AM
Unknown Object (File)
Dec 20 2023, 6:50 AM
Unknown Object (File)
Nov 27 2023, 3:55 PM
Unknown Object (File)
Nov 24 2023, 2:41 AM
Unknown Object (File)
Aug 27 2023, 4:49 AM
Unknown Object (File)
Aug 23 2023, 2:29 AM
Subscribers

Details

Summary
  • The only place in the tree which calls getnewvnode with mp == NULL does it for vp_crossmp which will never execute this codepath. Any vnode which legally has ->v_mount == NULL is also doomed, which once more wont execute this code.
  • removes an assertion for v_holdcnt from production kernels. it gets taken care of by refcount macros in debug kernels.
Test Plan

Will ask pho. Works for me in stress2.

Diff Detail

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

Event Timeline

kib added inline comments.
sys/kern/vfs_subr.c
3209 ↗(On Diff #65357)

vdrop_ret_to_free() I suggest

3223 ↗(On Diff #65357)

Would it be more reasonable to assert VI_ACTIVE in vdropl() ?

This revision is now accepted and ready to land.Dec 7 2019, 4:23 PM
sys/kern/vfs_subr.c
3209 ↗(On Diff #65357)

vdrop_free() ?

sys/kern/vfs_subr.c
3209 ↗(On Diff #65357)

vhold would use a clean up of similar nature with splitting the locked/unlocked variants and moving list manipulation elsewhere. with this in mind how about mnt_list_get/mnt_list_put or similar?

3223 ↗(On Diff #65357)

it would be dependent on VI_DOOMED. i can add the assert after the other change lands

  • refactor vhold
  • move VI_ACTIVE check early in vdropl
This revision now requires review to proceed.Dec 7 2019, 10:40 PM
mjg retitled this revision from vfs: refactor vdrop to vfs: refactor vdrop and vhold.Dec 7 2019, 10:41 PM

Can you commit just the move of the block of code to free the vnode into freevnode() ? The rest of changes would be easier to see then, esp. in reshuffling the asserts, if any.

  • rebase on head
  • put back checking for VI_ACTIVE. the invariant does not hold because vnlru reclaim can bump hold count without actually moving lists and later abort it if someone else bumped usecount. this is a bug since a used vnodes does not land on the active list. I'll propose a patch which happens to eliminate the problem as a side effect. In the meantime keep the bug-to-bug compatibility

Again, can vdrop_deactivate() and perhaps vhold_activate() committed separately ?

vdrop_deactivate contains the material change of not longer accepting mp == NULL and there are no functional changes past that.

asserts:

  • production kernels no longer assert anything
  • kernels with debug only have added assert that vnode is not doomed in vdrop_deactivate
In D22722#497647, @mjg wrote:

vdrop_deactivate contains the material change of not longer accepting mp == NULL and there are no functional changes past that.

asserts:

  • production kernels no longer assert anything
  • kernels with debug only have added assert that vnode is not doomed in vdrop_deactivate

Which is exactly the reason to split the move of existing code and then make changes listed above a separate diff.

mjg retitled this revision from vfs: refactor vdrop and vhold to vfs: remove production kernel checks and mp == NULL support from vdrop.
mjg edited the summary of this revision. (Show Details)
  • whack the other stuff. only material changes remain.

https://reviews.freebsd.org/D12126

This was the review that added support for mp == null. I don't understand why we needed it then or why we don't need it now. What conditions changed?

Huh, I should have checked where it came from, I assumed it was stale.

head definitely does not need it. If Isilon needs it for anything, they should provide a fake mount instead. Handling possibly NULL mp will only add cruft to future changes.

sys/kern/vfs_subr.c
3198 ↗(On Diff #65442)

This comment is stale, you need to move it to the proper place.

@bdrewery is the NULL check stuff you still use? can you add a mount point to your vnodes instead?

pho tested this, no issues.

I am fine with the code change. Hopefully you will get the answer from Isilon (or move forward if not).

This revision is now accepted and ready to land.Dec 13 2019, 4:53 PM