Print this page
OS-399 zone phys. mem. cap should be a rctl and have associated kstat

*** 20,29 **** --- 20,30 ---- */ /* * Copyright 2008 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. + * Copyright 2011 Joyent, Inc. All rights reserved. */ /* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */ /* All Rights Reserved */
*** 168,179 **** * If the non-global zone has a phys. memory cap, use that. * We always report the system-wide value for the global zone, * even though rcapd can be used on the global zone too. */ if (!INGLOBALZONE(curproc) && ! curproc->p_zone->zone_phys_mcap != 0) ! return (MIN(btop(curproc->p_zone->zone_phys_mcap), physinstalled)); return (physinstalled); case _CONFIG_AVPHYS_PAGES: --- 169,180 ---- * If the non-global zone has a phys. memory cap, use that. * We always report the system-wide value for the global zone, * even though rcapd can be used on the global zone too. */ if (!INGLOBALZONE(curproc) && ! curproc->p_zone->zone_phys_mem_ctl != UINT64_MAX) ! return (MIN(btop(curproc->p_zone->zone_phys_mem_ctl), physinstalled)); return (physinstalled); case _CONFIG_AVPHYS_PAGES:
*** 182,197 **** * the phys. memory cap - zone's current rss. We always * report the system-wide value for the global zone, even * though rcapd can be used on the global zone too. */ if (!INGLOBALZONE(curproc) && ! curproc->p_zone->zone_phys_mcap != 0) { pgcnt_t cap, rss, free; vmusage_t in_use; size_t cnt = 1; ! cap = btop(curproc->p_zone->zone_phys_mcap); if (cap > physinstalled) return (freemem); if (vm_getusage(VMUSAGE_ZONE, 1, &in_use, &cnt, FKIOCTL) != 0) --- 183,198 ---- * the phys. memory cap - zone's current rss. We always * report the system-wide value for the global zone, even * though rcapd can be used on the global zone too. */ if (!INGLOBALZONE(curproc) && ! curproc->p_zone->zone_phys_mem_ctl != UINT64_MAX) { pgcnt_t cap, rss, free; vmusage_t in_use; size_t cnt = 1; ! cap = btop(curproc->p_zone->zone_phys_mem_ctl); if (cap > physinstalled) return (freemem); if (vm_getusage(VMUSAGE_ZONE, 1, &in_use, &cnt, FKIOCTL) != 0)