Lines Matching defs:npages
291 anon_create(pgcnt_t npages, int flags)
305 ahp->size = npages;
306 if (npages <= ANON_CHUNK_SIZE || (flags & ANON_ALLOC_FORCE)) {
330 ahp->size = P2ROUNDUP(npages, ANON_CHUNK_SIZE);
348 anon_release(struct anon_hdr *ahp, pgcnt_t npages)
354 ASSERT(npages <= ahp->size);
359 if (npages <= ANON_CHUNK_SIZE || (ahp->flags & ANON_ALLOC_FORCE)) {
517 pgcnt_t npages, int flags)
524 ASSERT((npages <= sahp->size) && (npages <= dahp->size));
535 npages * sizeof (struct anon *));
551 while (npages != 0) {
556 if (chknp > npages)
557 chknp = npages;
574 npages -= chknp;
582 while (npages--) {
786 pgcnt_t npages = btopr(size);
794 if (rctl_incr_swap(p, zone, ptob(npages)) != 0) {
810 ("anon_resvmem: npages %lu takemem %u pswap %lu caller %p\n",
811 npages, takemem, pswap_pages, (void *)caller()));
813 if (npages <= pswap_pages) {
818 k_anoninfo.ani_phys_resv += npages;
834 * since (npages > pswap_pages) we need mem swap
837 ASSERT(npages > pswap_pages);
838 mswap_pages = npages - pswap_pages;
907 rctl_decr_swap(zone, ptob(npages));
918 pgcnt_t npages = btopr(size);
925 rctl_decr_swap(zone, ptob(npages));
941 MIN(k_anoninfo.ani_mem_resv, npages)));
944 k_anoninfo.ani_locked_swap), npages);
955 ASSERT(npages >= mem_free_pages);
956 phys_free_slots = npages - mem_free_pages;
972 npages, mem_resv, (void *)caller()));
1336 spgcnt_t npages;
1342 npages = btopr(size);
1343 while (npages > 0) {
1350 npages -= off;
1351 if (npages <= 0)
1364 npages--;
1388 spgcnt_t npages;
1399 npages = btopr(size);
1400 ASSERT(IS_P2ALIGNED(npages, pgcnt));
1405 while (npages > 0) {
1422 npages -= off;
1423 if (npages <= 0)
1474 npages -= pgcnt;
1499 spgcnt_t npages;
1508 npages = btopr(size);
1509 ASSERT(IS_P2ALIGNED(npages, pgcnt));
1512 while (npages > 0) {
1530 npages -= off;
1531 if (npages <= 0)
1572 npages -= pgcnt;
1585 spgcnt_t npages;
1589 npages = btopr(size);
1591 while (npages > 0) {
1597 npages -= index - old;
1598 if (npages <= 0)
1607 npages--;
1618 spgcnt_t npages;
1625 npages = btopr(size);
1626 ASSERT(IS_P2ALIGNED(npages, pgcnt));
1632 while (npages > 0) {
1649 npages -= off;
1650 if (npages <= 0)
1657 npages -= pgcnt;
1668 spgcnt_t npages = btopr(size);
1683 for (; npages > 0; index = (pgcnt == 1) ? index + 1 :
1684 P2ROUNDUP(index + 1, pgcnt), npages -= pgcnt) {
1695 * decrement npages by number of NULL anon slots we skipped
1697 npages -= index - old_idx;
1698 if (npages <= 0)
1804 if (!IS_P2ALIGNED(index, pgcnt) || npages < pgcnt) {
3497 * Used by segspt when it needs to lock reserved swap npages in memory
3500 anon_swap_adjust(pgcnt_t npages)
3511 if (npages > unlocked_mem_swap) {
3512 spgcnt_t adjusted_swap = npages - unlocked_mem_swap;
3529 k_anoninfo.ani_locked_swap += npages;
3544 anon_swap_restore(pgcnt_t npages)
3550 ASSERT(k_anoninfo.ani_locked_swap >= npages);
3551 k_anoninfo.ani_locked_swap -= npages;