asr driver with INVARIANT

Bruce Evans bde at zeta.org.au
Fri Dec 12 19:47:57 PST 2003


On Thu, 11 Dec 2003, Scott Long wrote:

> Fabien THOMAS wrote:
> > When compiled with INVARIANT the driver failed in debugger because the
> > memory flags is M_WAITOK.
> >
> > Is it really necessary to use M_WAITOK here ?
>
> Allocating any memory from within the strategy() path is generally a
> really bad idea no matter what.  However, changing this to M_NOWAIT
> means that a memory shortage will cause the I/O to fail.  What happens
> if the failed I/O request originated from the vm system trying to push
> pages to the swap partition in order to create more free memory?

Same as in the ata driver: things fail.  I accidentally saw failures
of malloc() in the ata driver when I broke vm.  The MALLOC_MAKE_FAILURES
options would give failures intentionly.  The problems that I saw were
mostly transient, but I mostly don't use swap.

Bruce


More information about the freebsd-scsi mailing list