Page MenuHomeFreeBSD

Add vm_page_grab_pages()
ClosedPublic

Authored by alc on Aug 8 2017, 4:31 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mar 10 2024, 1:03 AM
Unknown Object (File)
Feb 2 2024, 6:17 PM
Unknown Object (File)
Dec 20 2023, 3:06 AM
Unknown Object (File)
Nov 17 2023, 4:42 AM
Unknown Object (File)
Nov 1 2023, 3:46 PM
Unknown Object (File)
Oct 7 2023, 9:08 PM
Unknown Object (File)
Sep 10 2023, 10:01 AM
Unknown Object (File)
Sep 7 2023, 8:50 AM
Subscribers
None

Details

Summary

I've made some minor changes from the version that we've discussed in email. I highlight the notable ones below.

Diff Detail

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

Event Timeline

vm/vm_page.c
3202–3204 ↗(On Diff #31765)

I changed the way that this function determines if it needs to sleep on a page. This snippet is copied from vm_page_grab(). In many cases, the old version would perform both vm_page_xbusied() and vm_page_busied(). Now, we always do one or the other, never both.

3213 ↗(On Diff #31765)

I made the sleep channel message distinct from vm_page_grab().

This revision is now accepted and ready to land.Aug 8 2017, 4:40 PM
markj added inline comments.
vm/vm_page.c
3174 ↗(On Diff #31765)

The NOBUSY flag description needs to be updated.

Should vm_page_grab_pages() also include this assertion from vm_page_grab():

KASSERT((allocflags & VM_ALLOC_SBUSY) == 0 ||
    (allocflags & VM_ALLOC_IGN_SBUSY) != 0,
    ("vm_page_grab: VM_ALLOC_SBUSY/VM_ALLOC_IGN_SBUSY mismatch"));
alc edited edge metadata.

Update the description of VM_ALLOC_NOBUSY.

Update the block comment in vm_page.h to reflect the capabilities of vm_page_grab_pages().

This revision now requires review to proceed.Aug 8 2017, 5:02 PM
In D11926#247397, @alc wrote:

Should vm_page_grab_pages() also include this assertion from vm_page_grab():

KASSERT((allocflags & VM_ALLOC_SBUSY) == 0 ||
    (allocflags & VM_ALLOC_IGN_SBUSY) != 0,
    ("vm_page_grab: VM_ALLOC_SBUSY/VM_ALLOC_IGN_SBUSY mismatch"));

I can't see any reason not to, especially if we're considering implementing vm_page_grab() in terms of vm_page_grab_pages(). It might be that there's some valid use-case for specifying ALLOC_SBUSY without ALLOC_IGN_SBUSY, but until that arises it seems reasonable to be strict.

This revision was automatically updated to reflect the committed changes.