Re: contigmalloc(9) doesn't honour M_NOWAIT.

From: Peter Jeremy <peterjeremy_at_optushome.com.au>
Date: Wed, 10 May 2006 05:03:11 +1000
On Tue, 2006-May-09 16:03:12 +0200, Pawel Jakub Dawidek wrote:
>Using a USB pendrive can lead to kernel panic because of the issue
>mentioned in the subject.

See kern/78179.  Mark Tinguely and I have spent a far amount of time
fighting it.  We have made some improvement - bus_dmamem_alloc()
correctly supports BUS_DMA_NOWAIT so you get a runtime error instead
of a panic.  At this stage, the umass device needs to be re-written so
that it doesn't issue large contiguous mallocs at interrupt level.
The way forward would seem to be to make the USB subsystem support
scatter-gather (skeleton code already exists) to avoid the need for
contigmalloc().

Note that there are lots of other drivers that assume bus_dmamem_alloc()
can't fail, even when called with BUS_DMA_NOWAIT.

Also note that the umass device allocates the memory the first time it
is needed and never releases it.  This means that a workaround is to
access a file via umass fairly early after a reboot, whilst there is
still contiguous memory available.

-- 
Peter Jeremy

Received on Tue May 09 2006 - 17:03:23 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:55 UTC