Page MenuHomeFreeBSD

Unlocked grab for shm.
ClosedPublic

Authored by jeff on Feb 27 2020, 10:38 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Apr 10, 1:05 PM
Unknown Object (File)
Sun, Apr 7, 8:03 AM
Unknown Object (File)
Sun, Apr 7, 3:55 AM
Unknown Object (File)
Feb 24 2024, 5:22 PM
Unknown Object (File)
Jan 18 2024, 8:00 AM
Unknown Object (File)
Jan 13 2024, 11:55 PM
Unknown Object (File)
Jan 7 2024, 12:02 PM
Unknown Object (File)
Dec 30 2023, 6:34 PM
Subscribers

Details

Summary

This makes tmpfs more scalable but I want to point out something larger.

This demonstrates a highly scalable pattern that could be applied to all memory resident I/O. It has long been my intention to relegate the buffer cache to an increasingly narrow set of uses due to the legacy design and the scalability issues with lockmgr and exclusive buf locks.

After the introduction of a stronger busy guarantee and lockfree lookup, we can permit file I/O that only contends at the page level. You could eventually even avoid the shared vnode lock when reading cached data.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 29658
Build 27516: arc lint + arc unit

Event Timeline

jeff added reviewers: alc, dougm, kib, markj.
jeff set the repository for this revision to rS FreeBSD src repository - subversion.
sys/kern/uipc_shm.c
219

Nothing is preventing m from being freed once it is unbusied. The vm_page_activate() call must come first.

At the moment, vm_page_activate() only asserts that m->ref_count > 0. We could probably assert that the page is either busy or that the object is locked if ref_count == VPRC_OBJREF.

sys/kern/uipc_shm.c
219

Yeah that would be better. I just reshuffled it because I thought it was unnecessary but of course that makes sense.

Ok to commit after fix?

This revision is now accepted and ready to land.Feb 28 2020, 7:09 PM