Page MenuHomeFreeBSD

(lookup 2) vfs: add the infrastructure for lockless lookup
ClosedPublic

Authored by mjg on Jul 6 2020, 7:29 PM.

Details

Summary

Assorted changes split out from the complete diff. Some have value on their own, but for the most part are only there for the new lookup.

Diff Detail

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

mjg requested review of this revision.Jul 6 2020, 7:29 PM
sys/kern/kern_descrip.c
3354 ↗(On Diff #74149)

I am still surprised with such loops. Don't you need yield sometimes ?

sys/kern/vfs_subr.c
3083 ↗(On Diff #74149)

Why not extract this block from there and vget_finish() into a common function ?

sys/kern/kern_descrip.c
3354 ↗(On Diff #74149)

If worrying about excessive looping, I think the right solution is to do the above once and in case of failure take the lock.

sys/kern/vfs_subr.c
3083 ↗(On Diff #74149)

ok, will update later

sys/kern/kern_descrip.c
3354 ↗(On Diff #74149)

My concern that if we are on UP and mutator is preempted by this loop at the unlucky moment, system can be livelocked.

  • rebase

does not address vref_smr yet

sys/kern/vfs_subr.c
3083 ↗(On Diff #74149)

So I don't know how to name this. In the patchset I introduce vget_finish_ref later to facilitate WANTPARENT/!LOCKLEAF lookups, but I'm not going to call something like that from vref.

sys/kern/vfs_subr.c
3083 ↗(On Diff #74149)

I would call it vref_hold() or vget_ref_hold(). This name describes the action of the code.

  • add vfs_smr_entered_load
  • vget_finish_ref
sys/kern/vfs_subr.c
3083 ↗(On Diff #74149)

I reworked the only consumer of vref_smr to use vget direclty instead, thus getting rid of the problem for the time being.

This revision is now accepted and ready to land.Jul 13 2020, 6:24 PM
This revision was automatically updated to reflect the committed changes.