kern/78179: bus_dmamem_alloc() with BUS_DMA_NOWAIT can block

PeterJeremy at PeterJeremy at
Mon Feb 28 07:20:10 GMT 2005

>Number:         78179
>Category:       kern
>Synopsis:       bus_dmamem_alloc() with BUS_DMA_NOWAIT can block
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Feb 28 07:20:09 GMT 2005
>Originator:     Peter Jeremy
>Release:        FreeBSD 5.3-RELEASE-p5 i386
System: FreeBSD 5.3-RELEASE-p5 FreeBSD 5.3-RELEASE-p5 #2: Sat Feb 26 15:54:18 EST 2005 root at i386


	If a request for more than one page of memory is passed to 
	bus_dmamem_alloc(), contigmalloc() is used to allocate the
	requested memory.  bus_dmamem_alloc() defines a flag
	BUS_DMA_NOWAIT which specifies that bus_dmamem_alloc() is not
	to wait.

	BUS_DMA_NOWAIT is mapped to M_NOWAIT but contigmalloc() does not
	support M_NOWAIT and can block.  This problem appears to exist on
	4.x, 5.x and 6.x.

	I originally ran into the problem with USB transfers on FreeBSD
	4.10.  That particular problem was avoided by a patch to reduce
	the memory consumption of USB but the underlying inconsistency
	between bus_dmamem_alloc() and contigmalloc() remains.

	I don't have a specific procedure to reproduce the fault.


More information about the freebsd-bugs mailing list