Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 10 May 2006 05:03:11 +1000
From:      Peter Jeremy <peterjeremy@optushome.com.au>
To:        Pawel Jakub Dawidek <pjd@freebsd.org>
Cc:        Mark Tinguely <tinguely@casselton.net>, freebsd-current@freebsd.org, scottl@freebsd.org
Subject:   Re: contigmalloc(9) doesn't honour M_NOWAIT.
Message-ID:  <20060509190311.GA710@turion.vk2pj.dyndns.org>
In-Reply-To: <20060509140312.GA93453@garage.freebsd.pl>
References:  <20060509140312.GA93453@garage.freebsd.pl>

next in thread | previous in thread | raw e-mail | index | archive | help

--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--



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