From owner-svn-src-all@FreeBSD.ORG Thu May 7 20:57:06 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8BF7F106564A; Thu, 7 May 2009 20:57:06 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 79CE78FC1D; Thu, 7 May 2009 20:57:06 +0000 (UTC) (envelope-from kmacy@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n47Kv6s7067999; Thu, 7 May 2009 20:57:06 GMT (envelope-from kmacy@svn.freebsd.org) Received: (from kmacy@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n47Kv6wW067998; Thu, 7 May 2009 20:57:06 GMT (envelope-from kmacy@svn.freebsd.org) Message-Id: <200905072057.n47Kv6wW067998@svn.freebsd.org> From: Kip Macy Date: Thu, 7 May 2009 20:57:06 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r191902 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 07 May 2009 20:57:07 -0000 Author: kmacy Date: Thu May 7 20:57:06 2009 New Revision: 191902 URL: http://svn.freebsd.org/changeset/base/191902 Log: Allow the VM to provide backpressure on the ARC cache as it does on Solaris. Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c ============================================================================== --- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Thu May 7 20:39:23 2009 (r191901) +++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/arc.c Thu May 7 20:57:06 2009 (r191902) @@ -131,6 +131,8 @@ #include #include +#include + static kmutex_t arc_reclaim_thr_lock; static kcondvar_t arc_reclaim_thr_cv; /* used to signal reclaim thr */ static uint8_t arc_thread_exit; @@ -1809,6 +1811,13 @@ arc_reclaim_needed(void) #ifdef _KERNEL + /* + * If pages are needed or we're within 2048 pages + * of needing to page need to reclaim + */ + if (vm_pages_needed || (vm_paging_target() > -2048)) + return (1); + if (needfree) return (1);