Page MenuHomeFreeBSD

vm_page: Consolidate page busy sleep mechanisms
ClosedPublic

Authored by markj on Nov 11 2021, 5:34 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Apr 16, 3:05 AM
Unknown Object (File)
Jan 29 2024, 1:39 AM
Unknown Object (File)
Jan 7 2024, 2:39 AM
Unknown Object (File)
Dec 20 2023, 2:56 AM
Unknown Object (File)
Nov 2 2023, 4:28 PM
Unknown Object (File)
Sep 23 2023, 7:09 PM
Unknown Object (File)
Sep 16 2023, 1:00 AM
Unknown Object (File)
Aug 2 2023, 8:21 AM

Details

Summary
  • Modify vm_page_busy_sleep() and vm_page_busy_sleep_unlocked() to take a VM_ALLOC_* flag indicating whether to sleep on shared-busy, and fix up callers.
  • Modify vm_page_busy_sleep() to return a status indicating whether the object lock was dropped, and fix up callers.
  • Convert callers of vm_page_sleep_if_busy() to use vm_page_busy_sleep() instead.
  • Remove vm_page_sleep_if_(x)busy().

Obtained from: jeff (object_concurrency patches)

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 42766
Build 39654: arc lint + arc unit

Event Timeline

sys/vm/vm_page.c
1019–1020

It is somewhat strange API design.
Is it planned to allow other values for allocflags later on?

If you decide to reuse allocflags there, why not allow any flags and just operate on the (allocflags & VM_ALLOC_IGN_SBUSY) != 0? Or not reuse and then make (keep) allocflags bool argunment.

sys/vm/vm_page.c
1019–1020

I don't think there's any plan to permit other flags for now, but this way consumers use a standard terminology at least. I find it a bit nicer than a naked bool.

I could simply remove the assertion. Note that _vm_page_busy_sleep() does not have any assertion since some other calls will pass vm_page_grab* flags in unmodified.

sys/vm/vm_page.c
1019–1020

To me, removing the assertion looks reasonable.

markj marked 2 inline comments as done.

Drop assertions.

This revision is now accepted and ready to land.Nov 12 2021, 7:17 PM

Only seeing this now (I hadn't yet joined manpages when this was last touched).

To make this manual page easier to understand, I would draw a much more explicit connection between "busied" and "currently marked busy", and likewise between "busies" and "the kernel marks the page busy".

(Sorry for the earlier version, which said much more about English grammar than needed for this. That was me hitting submit too soon after thinking in writing.)

share/man/man9/vm_page_busy.9
122

"busied"

126

Same as above for "exclusively busied"

136–137

"busied" again, so I assume it wasn't a mistake above.

149

"unbusies"