diff options
author | Bryan Cantrill <bryan@joyent.com> | 2016-06-05 11:17:40 -0700 |
---|---|---|
committer | Robert Mustacchi <rm@joyent.com> | 2016-06-10 14:22:53 -0700 |
commit | 7de21d7cba3fddc724c51930845ad91d8082e0c7 (patch) | |
tree | ed849302ae6f68b51af91c077e5666f3b3c57db9 | |
parent | 30633d6fe588d756f1fe86999b090761e325844e (diff) | |
download | illumos-joyent-7de21d7cba3fddc724c51930845ad91d8082e0c7.tar.gz |
7056 tmpfs in a non-global zone does not abide by tmpfs_minfree
Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
Reviewed by: Robert Mustacchi <rm@joyent.com>
Reviewed by: Garrett D'Amore <garrett@damore.org>
Approved by: Richard Lowe <richlowe@richlowe.net>
-rw-r--r-- | usr/src/uts/common/vm/vm_anon.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/usr/src/uts/common/vm/vm_anon.c b/usr/src/uts/common/vm/vm_anon.c index 4fd32a3f4a..01db9b23d7 100644 --- a/usr/src/uts/common/vm/vm_anon.c +++ b/usr/src/uts/common/vm/vm_anon.c @@ -788,14 +788,21 @@ anon_resvmem(size_t size, boolean_t takemem, zone_t *zone, int tryhard) pgcnt_t pswap_pages = 0; proc_t *p = curproc; - if (zone != NULL && takemem) { + if (zone != NULL) { /* test zone.max-swap resource control */ mutex_enter(&p->p_lock); if (rctl_incr_swap(p, zone, ptob(npages)) != 0) { mutex_exit(&p->p_lock); - atomic_add_64(&zone->zone_anon_alloc_fail, 1); + + if (takemem) + atomic_add_64(&zone->zone_anon_alloc_fail, 1); + return (0); } + + if (!takemem) + rctl_decr_swap(zone, ptob(npages)); + mutex_exit(&p->p_lock); } mutex_enter(&anoninfo_lock); |