From owner-freebsd-scsi@FreeBSD.ORG Fri Dec 12 19:47:57 2003 Return-Path: Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 16C0616A4CE; Fri, 12 Dec 2003 19:47:57 -0800 (PST) Received: from mailman.zeta.org.au (mailman.zeta.org.au [203.26.10.16]) by mx1.FreeBSD.org (Postfix) with ESMTP id C2CE343D1F; Fri, 12 Dec 2003 19:47:54 -0800 (PST) (envelope-from bde@zeta.org.au) Received: from gamplex.bde.org (katana.zip.com.au [61.8.7.246]) by mailman.zeta.org.au (8.9.3p2/8.8.7) with ESMTP id OAA14078; Sat, 13 Dec 2003 14:47:52 +1100 Date: Sat, 13 Dec 2003 14:47:54 +1100 (EST) From: Bruce Evans X-X-Sender: bde@gamplex.bde.org To: Scott Long In-Reply-To: <3FD8FF91.9010702@freebsd.org> Message-ID: <20031213144044.I3311@gamplex.bde.org> References: <3FD8868C.4020208@netasq.com> <3FD8FF91.9010702@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII cc: freebsd-scsi@freebsd.org cc: Fabien THOMAS Subject: Re: asr driver with INVARIANT X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 13 Dec 2003 03:47:57 -0000 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