tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: config_alldevs_lock is evil

On Mon, Jan 11, 2010 at 10:57:44PM +0100, Matthias Drochner wrote:
> I'm not sure it is necessary to do device addition/removal at
> that high priority at all -- either it is done by normal threads
> which can wait, or the bus already needs to deal with unexpected
> removals in some way (like USB), and uses a helper thread.

My plan for a week or two has been to reduce the priority to IPL_VM.

config_detach(9) always happens in a thread context, however,
config_deactivate(9) calls (which also access alldevs) happen in
interrupt context at IPL_VM.

In my initial survey of config_deactivate(9) calls, it looked as if some
occurred at IPL_HIGH, but a subsequent survey turned up no such calls.

> Anyway, holding the global alldevs lock to look up a driver
> specific instance is wrong.

How would you suggest to synchronize access to the device_t array in a
cfdriver_t?  I could use a mutex per cfdriver_t, just for example, but
maybe you have in mind a better way.


David Young             OJC Technologies      Urbana, IL * (217) 278-3933

Home | Main Index | Thread Index | Old Index