From owner-freebsd-hackers@FreeBSD.ORG Fri Jul 13 06:11:56 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 42D62106564A; Fri, 13 Jul 2012 06:11:56 +0000 (UTC) (envelope-from alc@rice.edu) Received: from mh10.mail.rice.edu (mh10.mail.rice.edu [128.42.201.30]) by mx1.freebsd.org (Postfix) with ESMTP id 120FB8FC0A; Fri, 13 Jul 2012 06:11:56 +0000 (UTC) Received: from mh10.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh10.mail.rice.edu (Postfix) with ESMTP id 91AD2606F1; Fri, 13 Jul 2012 01:11:53 -0500 (CDT) Received: from mh10.mail.rice.edu (localhost.localdomain [127.0.0.1]) by mh10.mail.rice.edu (Postfix) with ESMTP id 76E1F606FF; Fri, 13 Jul 2012 01:11:53 -0500 (CDT) X-Virus-Scanned: by amavis-2.7.0 at mh10.mail.rice.edu, auth channel Received: from mh10.mail.rice.edu ([127.0.0.1]) by mh10.mail.rice.edu (mh10.mail.rice.edu [127.0.0.1]) (amavis, port 10026) with ESMTP id 6J4bJ5Jog9XJ; Fri, 13 Jul 2012 01:11:53 -0500 (CDT) Received: from adsl-216-63-78-18.dsl.hstntx.swbell.net (adsl-216-63-78-18.dsl.hstntx.swbell.net [216.63.78.18]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh10.mail.rice.edu (Postfix) with ESMTPSA id DA997606F1; Fri, 13 Jul 2012 01:11:52 -0500 (CDT) Message-ID: <4FFFBC27.3090402@rice.edu> Date: Fri, 13 Jul 2012 01:11:51 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:8.0) Gecko/20111113 Thunderbird/8.0 MIME-Version: 1.0 To: John Baldwin References: <20120703111753.GB72292@server.rulingia.com> <20120708110516.GA38312@server.rulingia.com> <201207120826.05577.jhb@freebsd.org> In-Reply-To: <201207120826.05577.jhb@freebsd.org> Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit Cc: Alan Cox , freebsd-hackers@freebsd.org, Warner Losh Subject: Re: contigmalloc() breaking Xorg X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Jul 2012 06:11:56 -0000 On 07/12/2012 07:26, John Baldwin wrote: > [ Adding alc@ for VM stuff, Warner for arm/mips bus dma brokenness ] When the code underlying contigmalloc() fails in its initial attempt to allocate memory and proceeds to launder and reclaim pages, it should almost certainly do as the page daemon does and invoke the vm_lowmem handlers. In particular, this should coax the ZFS ARC into releasing some of its hoard of wired memory. Try this: Index: vm/vm_contig.c =================================================================== --- vm/vm_contig.c (revision 238372) +++ vm/vm_contig.c (working copy) @@ -192,6 +192,18 @@ vm_contig_grow_cache(int tries, vm_paddr_t low, vm { int actl, actmax, inactl, inactmax; + if (tries > 0) { + /* + * Decrease registered cache sizes. + */ + 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;