Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Jul 2012 01:11:51 -0500
From:      Alan Cox <alc@rice.edu>
To:        John Baldwin <jhb@freebsd.org>
Cc:        Alan Cox <alc@freebsd.org>, freebsd-hackers@freebsd.org, Warner Losh <imp@freebsd.org>
Subject:   Re: contigmalloc() breaking Xorg
Message-ID:  <4FFFBC27.3090402@rice.edu>
In-Reply-To: <201207120826.05577.jhb@freebsd.org>
References:  <20120703111753.GB72292@server.rulingia.com> <20120708110516.GA38312@server.rulingia.com> <201207120826.05577.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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;





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4FFFBC27.3090402>