Date: Thu, 1 Aug 2002 14:15:51 -0400 (EDT) From: Andrew Gallatin <gallatin@cs.duke.edu> To: Alan Cox <alc@cs.rice.edu> Cc: Peter Wemm <peter@wemm.org>, John Baldwin <jhb@FreeBSD.org>, freebsd-smp@FreeBSD.org Subject: Re: INTR_MPSAFE network drivers Message-ID: <15689.31447.889898.252092@grasshopper.cs.duke.edu> In-Reply-To: <20020801174855.GE9934@cs.rice.edu> References: <XFMail.20020729175342.jhb@FreeBSD.org> <20020730000345.E0D9F2A7D6@canning.wemm.org> <15686.48913.150407.307190@grasshopper.cs.duke.edu> <20020730171226.GA26599@cs.rice.edu> <15688.22002.772933.316104@grasshopper.cs.duke.edu> <20020801021235.GD9934@cs.rice.edu> <15689.8042.488037.968605@grasshopper.cs.duke.edu> <20020801174855.GE9934@cs.rice.edu>
next in thread | previous in thread | raw e-mail | index | archive | help
Alan Cox writes: > > By requiring a top-half thread to hold Giant before acquiring the > kernel_map or mb_map locks, we are guaranteeing to the legacy driver > that those locks will be free once they get Giant. Consequently, the > driver won't be put to sleep in mid operation because it failed to get > the kernel_map or mb_map lock. Thanks for the spoon feeding. I think I understand now. Next question: Unless I'm mistaken, that means that non-legacy network drivers will not be able to move out from under Giant until there is a way to allocate mbufs which is is certain to never call into the vm system for anything (eg, make M_DONTWAIT really mean M_DONTWAIT). Hmm.. we could have a mclalloc kproc (like -stable does for MCLBYTES > PAGE_SIZE), which would be awakened by the mbuf code in the case that it could not fufill an interrupt time allocation which required calling malloc. I suppose another way to go would be if drivers are prepared to drop their driver locks and get Giant before calling into m_get*. I think most drivers can easily deal with m*get returning NULL, but that it would complicate the locking quite a bit to have to drop driver locks in the middle of the receive path, get Giant, call m_get*, drop Giant, then get driver locks back. Thanks, Drew To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-smp" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?15689.31447.889898.252092>