kern/78179: bus_dmamem_alloc() with BUS_DMA_NOWAIT can block

Peter Jeremy PeterJeremy at optushome.com.au
Fri Jan 6 15:00:26 PST 2006


The following reply was made to PR kern/78179; it has been noted by GNATS.

From: Peter Jeremy <PeterJeremy at optushome.com.au>
To: Mark Tinguely <tinguely at casselton.net>
Cc: bug-followup at freebsd.org
Subject: Re: kern/78179: bus_dmamem_alloc() with BUS_DMA_NOWAIT can block
Date: Sat, 7 Jan 2006 09:59:22 +1100

 On Thu, 2005-Nov-17 16:04:14 -0600, Mark Tinguely wrote:
 >I took a stab at the problem that NOWAIT is not being honored in
 >contigmalloc() by making the vm_contig_launder_page() honor
 >the flag.
 
 I've been running your code for about a month now and it doesn't seem
 to help.  Accessing a umass device after the system has been up for
 more than a few days is still an instant panic:
 
 bwait(cbe922d8,44,c070d9ac,509,0) at bwait+0x60
 swap_pager_putpages(c3e6bce4,d56a696c,1,1,d56a6920) at swap_pager_putpages+0x47a
 vm_pageout_flush(d56a696c,1,0,60,c06fa047) at vm_pageout_flush+0x16b
 vm_contig_launder_page(c1906e48,1,c070e406,203,ffffffff) at vm_contig_launder_page+0x2f9
 vm_page_alloc_contig(10,0,0,ffffffff,1) at vm_page_alloc_contig+0x254
 contigmalloc(10000,c073b0a0,1,0,ffffffff) at contigmalloc+0xbc
 bus_dmamem_alloc(c2138300,c2270488,5,c2270484,ffffffff) at bus_dmamem_alloc+0xd2
 usb_block_allocmem(0,10000,1,c319c33c,d56a6a9c) at usb_block_allocmem+0x180
 uhci_allocm(c1c3c000,c319c33c,10000,10c,6) at uhci_allocm+0x27
 
 bwait(cbe90bc8,44,c0712862,509,0) at bwait+0x60
 swap_pager_putpages(c3653210,d56a6874,1,1,d56a6820) at swap_pager_putpages+0x47a
 vm_pageout_flush(d56a6874,1,0,60,c06feef8) at vm_pageout_flush+0x16b
 vm_contig_launder_page(c19070d0,1,c07132bc,203,ffffffff) at vm_contig_launder_page+0x2f9
 vm_page_alloc_contig(19,0,0,ffffffff,10) at vm_page_alloc_contig+0x254
 contigmalloc(1827c,c0745e40,1,0,ffffffff) at contigmalloc+0xbc
 bus_dmamem_alloc(c2f14800,d56a6978,5,d56a697c,ffffffff) at bus_dmamem_alloc+0xd2
 usb_alloc_mem(18270,4,d56a6b10,10000,c0703afb) at usb_alloc_mem+0xb4
 uhci_xfer_setup(c1bfc400,0,d56a6b08,d56a6b10,d56a6b24) at uhci_xfer_setup+0x40b
 
 Interestingly, none of your "vm_contig_launder_page: would sleep"
 printf's are triggered.  Looking at the code, the problem is that
 vm_pageout_flush() forces VM_PAGER_PUT_SYNC if the given object is
 kernel_object.  I don't understand the VM subsystem well enough to
 know why this is done.
 
 -- 
 Peter Jeremy


More information about the freebsd-bugs mailing list