I've made some minor changes from the version that we've discussed in email. I highlight the notable ones below.
Details
Diff Detail
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
vm/vm_page.c | ||
---|---|---|
3202–3204 | 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 | I made the sleep channel message distinct from vm_page_grab(). |
vm/vm_page.c | ||
---|---|---|
3174 | 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"));
Update the description of VM_ALLOC_NOBUSY.
Update the block comment in vm_page.h to reflect the capabilities of vm_page_grab_pages().
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.