* Allocate physical pages, following the specified NUMA policy, to back a * kernel stack. */
| 412 | * kernel stack. |
| 413 | */ |
| 414 | void |
| 415 | vm_thread_stack_back(struct domainset *ds, vm_offset_t ks, vm_page_t ma[], |
| 416 | int npages, int req_class) |
| 417 | { |
| 418 | vm_pindex_t pindex; |
| 419 | int n; |
| 420 | |
| 421 | pindex = atop(ks - VM_MIN_KERNEL_ADDRESS); |
| 422 | |
| 423 | VM_OBJECT_WLOCK(kstack_object); |
| 424 | for (n = 0; n < npages;) { |
| 425 | if (vm_ndomains > 1) |
| 426 | kstack_object->domain.dr_policy = ds; |
| 427 | |
| 428 | /* |
| 429 | * Use WAITFAIL to force a reset of the domain selection policy |
| 430 | * if we had to sleep for pages. |
| 431 | */ |
| 432 | n += vm_page_grab_pages(kstack_object, pindex + n, |
| 433 | req_class | VM_ALLOC_WIRED | VM_ALLOC_WAITFAIL, |
| 434 | &ma[n], npages - n); |
| 435 | } |
| 436 | VM_OBJECT_WUNLOCK(kstack_object); |
| 437 | } |
| 438 | |
| 439 | static int |
| 440 | kstack_import(void *arg, void **store, int cnt, int domain, int flags) |
no test coverage detected