Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 13 Dec 2003 14:47:54 +1100 (EST)
From:      Bruce Evans <bde@zeta.org.au>
To:        Scott Long <scottl@freebsd.org>
Cc:        Fabien THOMAS <fabien.thomas@netasq.com>
Subject:   Re: asr driver with INVARIANT
Message-ID:  <20031213144044.I3311@gamplex.bde.org>
In-Reply-To: <3FD8FF91.9010702@freebsd.org>
References:  <3FD8868C.4020208@netasq.com> <3FD8FF91.9010702@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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


Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20031213144044.I3311>