MCPcopy Create free account
hub / github.com/F-Stack/f-stack / vm_thread_stack_back

Function vm_thread_stack_back

freebsd/vm/vm_glue.c:414–437  ·  view source on GitHub ↗

* Allocate physical pages, following the specified NUMA policy, to back a * kernel stack. */

Source from the content-addressed store, hash-verified

412 * kernel stack.
413 */
414void
415vm_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
439static int
440kstack_import(void *arg, void **store, int cnt, int domain, int flags)

Callers 2

vm_thread_stack_createFunction · 0.85
vm_thread_swapinFunction · 0.85

Calls 1

vm_page_grab_pagesFunction · 0.85

Tested by

no test coverage detected