Subject: Re: M_NOWAIT during attach
To: None <tech-kern@netbsd.org>
From: Bill Stouder-Studenmund <wrstuden@netbsd.org>
List: tech-kern
Date: 11/05/2007 13:54:36
--r4QXMf6/kyF/FvJJ
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
On Mon, Nov 05, 2007 at 09:22:57PM +0100, Joerg Sonnenberger wrote:
> Hi all,
> why are many drivers currently using M_NOWAIT during attach?
> I understand that sleeping on allocations would fail during boot, but
> device attachment can happen later, especially if we ever want to get
> LKMs working. If anything, this should be detected by malloc/free
> internally. The default behaviour for drivers in such cases is panic as
> well.
Sounds good.
> Can we change this to just use M_WAITOK if the allocation doesn't happen
> from interrupt context?
Sure. Though for attach, I think we shouldn't be attaching stuff in an
interrupt context. I think that if we detect new hardware, we should
trigger a thread to come along and config everything.
Take care,
Bill
--r4QXMf6/kyF/FvJJ
Content-Type: application/pgp-signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (NetBSD)
iD8DBQFHL5EcWz+3JHUci9cRApOWAKCHNGiBpLviEeQmTzDZjTsZp7h+LgCeIe5y
PECaOxBaKB7LdkANGftqVpM=
=yUvC
-----END PGP SIGNATURE-----
--r4QXMf6/kyF/FvJJ--