From owner-freebsd-current@FreeBSD.ORG Tue May 9 19:03:23 2006 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E187E16A784; Tue, 9 May 2006 19:03:23 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from mail05.syd.optusnet.com.au (mail05.syd.optusnet.com.au [211.29.132.186]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1DC8643D5D; Tue, 9 May 2006 19:03:21 +0000 (GMT) (envelope-from peterjeremy@optushome.com.au) Received: from turion.vk2pj.dyndns.org (c220-239-19-236.belrs4.nsw.optusnet.com.au [220.239.19.236]) by mail05.syd.optusnet.com.au (8.12.11/8.12.11) with ESMTP id k49J3CCP011552 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO); Wed, 10 May 2006 05:03:12 +1000 Received: from turion.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by turion.vk2pj.dyndns.org (8.13.6/8.13.6) with ESMTP id k49J3C90003194; Wed, 10 May 2006 05:03:12 +1000 (EST) (envelope-from peter@turion.vk2pj.dyndns.org) Received: (from peter@localhost) by turion.vk2pj.dyndns.org (8.13.6/8.13.6/Submit) id k49J3BEm003193; Wed, 10 May 2006 05:03:11 +1000 (EST) (envelope-from peter) Date: Wed, 10 May 2006 05:03:11 +1000 From: Peter Jeremy To: Pawel Jakub Dawidek Message-ID: <20060509190311.GA710@turion.vk2pj.dyndns.org> Mail-Followup-To: Peter Jeremy , Pawel Jakub Dawidek , freebsd-current@freebsd.org, green@freebsd.org, scottl@freebsd.org, Mark Tinguely References: <20060509140312.GA93453@garage.freebsd.pl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="0OAP2g/MAC+5xKAE" Content-Disposition: inline In-Reply-To: <20060509140312.GA93453@garage.freebsd.pl> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.11 Cc: Mark Tinguely , freebsd-current@freebsd.org, scottl@freebsd.org Subject: Re: contigmalloc(9) doesn't honour M_NOWAIT. X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 May 2006 19:03:24 -0000 --0OAP2g/MAC+5xKAE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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. --=20 Peter Jeremy --0OAP2g/MAC+5xKAE Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.3 (FreeBSD) iD8DBQFEYOdu/opHv/APuIcRAkYrAJ0SLyp058wdj2vF7+FMKWnMkRi1RQCfcIbU kkwKQPgj+hcpFMMuOeGOg2Q= =3L7+ -----END PGP SIGNATURE----- --0OAP2g/MAC+5xKAE--