1604
1605 if (RESTRICT4G_ALLOC) {
1606 VM_STAT_ADD(vmm_vmstats.restrict4gcnt);
1607 /* here only for > 4g systems */
1608 *flags |= PGI_MT_RANGE4G;
1609 } else if (RESTRICT16M_ALLOC(freemem, btop(pgsz), *flags)) {
1610 *flags |= PGI_MT_RANGE16M;
1611 } else {
1612 VM_STAT_ADD(vmm_vmstats.unrestrict16mcnt);
1613 VM_STAT_COND_ADD((*flags & PG_PANIC), vmm_vmstats.pgpanicalloc);
1614 *flags |= PGI_MT_RANGE0;
1615 }
1616 #endif /* !__xpv */
1617 return (mtype);
1618 }
1619
1620
1621 /* mtype init for page_get_replacement_page */
1622 /*ARGSUSED*/
1623 int
1624 mtype_pgr_init(int *flags, page_t *pp, int mnode, pgcnt_t pgcnt)
1625 {
1626 int mtype = mtypetop;
1627 #if !defined(__xpv)
1628 if (RESTRICT16M_ALLOC(freemem, pgcnt, *flags)) {
1629 *flags |= PGI_MT_RANGE16M;
1630 } else {
1631 VM_STAT_ADD(vmm_vmstats.unrestrict16mcnt);
1632 *flags |= PGI_MT_RANGE0;
1633 }
1634 #endif
1635 return (mtype);
1636 }
1637
1638 /*
1639 * Determine if the mnode range specified in mtype contains memory belonging
1640 * to memory node mnode. If flags & PGI_MT_RANGE is set then mtype contains
1641 * the range from high pfn to 0, 16m or 4g.
1642 *
1643 * Return first mnode range type index found otherwise return -1 if none found.
1644 */
|
1604
1605 if (RESTRICT4G_ALLOC) {
1606 VM_STAT_ADD(vmm_vmstats.restrict4gcnt);
1607 /* here only for > 4g systems */
1608 *flags |= PGI_MT_RANGE4G;
1609 } else if (RESTRICT16M_ALLOC(freemem, btop(pgsz), *flags)) {
1610 *flags |= PGI_MT_RANGE16M;
1611 } else {
1612 VM_STAT_ADD(vmm_vmstats.unrestrict16mcnt);
1613 VM_STAT_COND_ADD((*flags & PG_PANIC), vmm_vmstats.pgpanicalloc);
1614 *flags |= PGI_MT_RANGE0;
1615 }
1616 #endif /* !__xpv */
1617 return (mtype);
1618 }
1619
1620
1621 /* mtype init for page_get_replacement_page */
1622 /*ARGSUSED*/
1623 int
1624 mtype_pgr_init(int *flags, page_t *pp, pgcnt_t pgcnt)
1625 {
1626 int mtype = mtypetop;
1627 #if !defined(__xpv)
1628 if (RESTRICT16M_ALLOC(freemem, pgcnt, *flags)) {
1629 *flags |= PGI_MT_RANGE16M;
1630 } else {
1631 VM_STAT_ADD(vmm_vmstats.unrestrict16mcnt);
1632 *flags |= PGI_MT_RANGE0;
1633 }
1634 #endif
1635 return (mtype);
1636 }
1637
1638 /*
1639 * Determine if the mnode range specified in mtype contains memory belonging
1640 * to memory node mnode. If flags & PGI_MT_RANGE is set then mtype contains
1641 * the range from high pfn to 0, 16m or 4g.
1642 *
1643 * Return first mnode range type index found otherwise return -1 if none found.
1644 */
|