From owner-freebsd-scsi@FreeBSD.ORG Thu Dec 11 15:38:06 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 409C016A4CF for ; Thu, 11 Dec 2003 15:38:06 -0800 (PST) Received: from smtp.mho.com (smtp.mho.net [64.58.4.6]) by mx1.FreeBSD.org (Postfix) with SMTP id 16E4743D09 for ; Thu, 11 Dec 2003 15:38:05 -0800 (PST) (envelope-from scottl@freebsd.org) Received: (qmail 94051 invoked by uid 1002); 11 Dec 2003 23:38:04 -0000 Received: from unknown (HELO freebsd.org) (64.58.1.252) by smtp.mho.net with SMTP; 11 Dec 2003 23:38:04 -0000 Message-ID: <3FD8FF91.9010702@freebsd.org> Date: Thu, 11 Dec 2003 16:36:49 -0700 From: Scott Long User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.5) Gecko/20031103 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Fabien THOMAS References: <3FD8868C.4020208@netasq.com> In-Reply-To: <3FD8868C.4020208@netasq.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-scsi@freebsd.org 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: Thu, 11 Dec 2003 23:38:06 -0000 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 ? > > fabien > > 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? The better solution is to pre-allocate all resources needed in this path. Unfortunately, the asr driver is maintainerless. I and many others on this list would be happy to review any patches that you come up with to solve this problem. Scott