contigmalloc(9) doesn't honour M_NOWAIT.
Peter Jeremy
peterjeremy at optushome.com.au
Tue May 9 19:03:24 UTC 2006
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-current/attachments/20060509/8aaa4a40/attachment.pgp
More information about the freebsd-current
mailing list