Page MenuHomeFreeBSD

Unlocked grab for shm.
ClosedPublic

Authored by jeff on Feb 27 2020, 10:38 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 23, 12:06 AM
Unknown Object (File)
Nov 2 2024, 3:42 AM
Unknown Object (File)
Nov 1 2024, 4:07 PM
Unknown Object (File)
Sep 25 2024, 11:05 AM
Unknown Object (File)
Sep 13 2024, 12:02 AM
Unknown Object (File)
Sep 7 2024, 5:37 AM
Unknown Object (File)
Sep 4 2024, 5:44 AM
Unknown Object (File)
Aug 14 2024, 1:47 AM
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

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

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 ↗(On Diff #68923)

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 ↗(On Diff #68923)

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