summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorJohn Sonnenschein <johns@joyent.com>2012-01-13 00:08:54 +0000
committerJohn Sonnenschein <johns@joyent.com>2012-01-13 00:08:54 +0000
commit4ec159e93280851f8200f5f32558ae1ba82fd1dd (patch)
treec306bcba55eae5284ed980acc1e6b460ee508ef7 /usr/src
parent9aac36a25d67d80901ad3284d1c2045d3d1a6d64 (diff)
parentcc663ce2a435336bef777ce673fbd1fba233349b (diff)
downloadillumos-joyent-4ec159e93280851f8200f5f32558ae1ba82fd1dd.tar.gz
Merge branch 'master' of git.joyent.com:illumos-joyent
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/uts/common/fs/zfs/arc.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/usr/src/uts/common/fs/zfs/arc.c b/usr/src/uts/common/fs/zfs/arc.c
index a4adb09e16..98aad58025 100644
--- a/usr/src/uts/common/fs/zfs/arc.c
+++ b/usr/src/uts/common/fs/zfs/arc.c
@@ -22,6 +22,7 @@
* Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
* Copyright 2011 Nexenta Systems, Inc. All rights reserved.
* Copyright (c) 2011 by Delphix. All rights reserved.
+ * Copyright (c) 2012, Joyent, Inc. All rights reserved.
*/
/*
@@ -2018,6 +2019,16 @@ arc_reclaim_needed(void)
if (availrmem < swapfs_minfree + swapfs_reserve + extra)
return (1);
+ /*
+ * Check that we have enough availrmem that memory locking (e.g., via
+ * mlock(3C) or memcntl(2)) can still succeed. (pages_pp_maximum
+ * stores the number of pages that cannot be locked; when availrmem
+ * drops below pages_pp_maximum, page locking mechanisms such as
+ * page_pp_lock() will fail.)
+ */
+ if (availrmem <= pages_pp_maximum)
+ return (1);
+
#if defined(__i386)
/*
* If we're on an i386 platform, it's possible that we'll exhaust the