From owner-svn-src-all@FreeBSD.ORG Sat Jul 14 20:14:04 2012 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 674691065672; Sat, 14 Jul 2012 20:14:04 +0000 (UTC) (envelope-from alc@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 524188FC12; Sat, 14 Jul 2012 20:14:04 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q6EKE46e005214; Sat, 14 Jul 2012 20:14:04 GMT (envelope-from alc@svn.freebsd.org) Received: (from alc@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q6EKE44O005212; Sat, 14 Jul 2012 20:14:04 GMT (envelope-from alc@svn.freebsd.org) Message-Id: <201207142014.q6EKE44O005212@svn.freebsd.org> From: Alan Cox Date: Sat, 14 Jul 2012 20:14:04 +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: r238456 - head/sys/vm 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: Sat, 14 Jul 2012 20:14:04 -0000 Author: alc Date: Sat Jul 14 20:14:03 2012 New Revision: 238456 URL: http://svn.freebsd.org/changeset/base/238456 Log: If vm_contig_grow_cache() is allowed to sleep, then invoke the vm_lowmem handlers. Modified: head/sys/vm/vm_contig.c Modified: head/sys/vm/vm_contig.c ============================================================================== --- head/sys/vm/vm_contig.c Sat Jul 14 20:08:03 2012 (r238455) +++ head/sys/vm/vm_contig.c Sat Jul 14 20:14:03 2012 (r238456) @@ -64,6 +64,7 @@ __FBSDID("$FreeBSD$"); #include #include +#include #include #include #include @@ -189,6 +190,20 @@ vm_contig_grow_cache(int tries, vm_paddr { int actl, actmax, inactl, inactmax; + if (tries > 0) { + /* + * Decrease registered cache sizes. The vm_lowmem handlers + * may acquire locks and/or sleep, so they can only be invoked + * when "tries" is greater than zero. + */ + EVENTHANDLER_INVOKE(vm_lowmem, 0); + + /* + * We do this explicitly after the caches have been drained + * above. + */ + uma_reclaim(); + } vm_page_lock_queues(); inactl = 0; inactmax = tries < 1 ? 0 : cnt.v_inactive_count;