| 2497 | } |
| 2498 | |
| 2499 | static int |
| 2500 | vm_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 | |
| 2527 | static void |
| 2528 | vm_page_zone_release(void *arg, void **store, int cnt) |
nothing calls this directly
no test coverage detected