Page MenuHomeFreeBSD

Use atomics for object reference count so that we can use the shared lock to protect it.
ClosedPublic

Authored by jeff on Sep 10 2019, 8:34 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Dec 30, 5:41 AM
Unknown Object (File)
Sat, Dec 21, 3:09 PM
Unknown Object (File)
Nov 30 2024, 6:15 PM
Unknown Object (File)
Nov 24 2024, 3:00 AM
Unknown Object (File)
Oct 25 2024, 8:22 PM
Unknown Object (File)
Oct 9 2024, 8:51 PM
Unknown Object (File)
Oct 4 2024, 3:34 PM
Unknown Object (File)
Sep 13 2024, 3:13 PM
Subscribers

Details

Summary

This allows for shared locks in some cases where we are manipulating the object reference count.

It would be possible for non-vnode objects to actually atomically drop the reference count with no lock held as long as it is above 2. Callers that expect stable reference counts with the write lock held only require it stay stable below 2. The relationship between the object and vnode reference counts make this much more complex for vnodes. I would like to refactor this so we only bump the vnode ref for the first object ref but it requires other changes to vfs.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 26395
Build 24852: arc lint + arc unit

Event Timeline

jeff added reviewers: alc, kib, markj, dougm.
This revision is now accepted and ready to land.Sep 22 2019, 1:42 PM
sys/vm/vm_object.c
525

BTW, why do you need the object lock there at all ? The object->type can only migrate from OBJT_VNODE to OBJT_DEAD until we hold the reference.