tech-kern archive

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

re: Locking strategy for device deletion (also see PR kern/48536)



>    that one i think is a much larger issue that affects *all* of our
>    drivers and needs a general fix where eg device_lookup_private()
>    returns a reference counted value that must be returned, before the
>    module can be considered ready to unload (this still leaves a very
>    minor race between device_put(d); and return;...)
> 
> I have the attached patch in my tree to add reference counting to
> device_private.  I haven't committed it yet because I haven't made a
> proof-of-concept bug nor adapted any drivers to use it to demonstrate
> fixing the bug.

someone should do this :-)

> I'm also not sure reference counts are the right way to go: that would
> incur interprocessor synchronization for each device read/write/ioctl.
> It may be that passive references, or per-CPU counters like dyoung@
> mentioned, are a better way to go.

that's why i said "eg device_lookup_private() returns a reference
counted value" :-)  the as long as there are get and put operations
that DTRT and are easy to use programatically, that's all we need.

patch idea looks sane to me.


.mrg.


Home | Main Index | Thread Index | Old Index