DragonFly kernel List (threaded) for 2007-01
DragonFly BSD
DragonFly kernel List (threaded) for 2007-01
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: [PATCH] Dynamic kernel environment support (kgetenv() and friends), ACPI quirks


From: "Thomas E. Spanjaard" <tgen@xxxxxxxxxxxxx>
Date: Sat, 13 Jan 2007 20:21:58 +0000

Thomas E. Spanjaard wrote:
Matthew Dillon wrote:
    * kenv_uninit() is holding a spin lock across a kfree(), which is
      not legal.  Of course, insofar as I can tell, kenv_uninit() will
      never run since it is a SYSUNINIT in a mandatry kernel module,
      so you could probably remove the whole routine and remove the
      SYSUNINIT :-).
Yeah, I should just set kenv_isdynamic=0 right after locking, then unlocking again, which would be sufficient.

Scratch that, there's always the possibility some other code is spinning on the lock while we set kenv_isdynamic to 0, e.g. in ksetenv() there's a large enough window. First set kenv_isdynamic to 0 (possibly with mplock held), spin on the lock to make sure all other threads are done with whatever they were doing while holding the lock, unlock, then free all stuff. But it doesn't matter ;).


Cheers,
--
        Thomas E. Spanjaard
        tgen@netphreax.net

Attachment: signature.asc
Description: OpenPGP digital signature



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