Print this page
OS-399 zone phys. mem. cap should be a rctl and have associated kstat
@@ -20,10 +20,11 @@
*/
/*
* 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,12 +169,12 @@
* 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),
+ 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,16 +183,16 @@
* 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) {
+ 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_mcap);
+ 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)