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

Function vm_page_zone_import

freebsd/vm/vm_page.c:2499–2525  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2497}
2498
2499static int
2500vm_page_zone_import(void *arg, void **store, int cnt, int domain, int flags)
2501{
2502 struct vm_domain *vmd;
2503 struct vm_pgcache *pgcache;
2504 int i;
2505
2506 pgcache = arg;
2507 vmd = VM_DOMAIN(pgcache->domain);
2508
2509 /*
2510 * The page daemon should avoid creating extra memory pressure since its
2511 * main purpose is to replenish the store of free pages.
2512 */
2513 if (vmd->vmd_severeset || curproc == pageproc ||
2514 !_vm_domain_allocate(vmd, VM_ALLOC_NORMAL, cnt))
2515 return (0);
2516 domain = vmd->vmd_domain;
2517 vm_domain_free_lock(vmd);
2518 i = vm_phys_alloc_npages(domain, pgcache->pool, cnt,
2519 (vm_page_t *)store);
2520 vm_domain_free_unlock(vmd);
2521 if (cnt != i)
2522 vm_domain_freecnt_inc(vmd, cnt - i);
2523
2524 return (i);
2525}
2526
2527static void
2528vm_page_zone_release(void *arg, void **store, int cnt)

Callers

nothing calls this directly

Calls 3

_vm_domain_allocateFunction · 0.85
vm_phys_alloc_npagesFunction · 0.85
vm_domain_freecnt_incFunction · 0.85

Tested by

no test coverage detected