DragonFly kernel List (threaded) for 2010-08
[
Date Prev][
Date Next]
[
Thread Prev][
Thread Next]
[
Date Index][
Thread Index]
Reminder on use of spinlocks
I've noticed a few situations where people are holding spinlocks
across complex procedure calls such as kfree(). This is not legal.
spinlocks can only be held across local code for very short
duration. Lockmgr locks, tokens, or mutexes should be used
in more complex situations.
With regards to locking up subsystems with tokens, I've notice a
tad bit of blindly calling lwkt_gettoken()/reltoken in every
procedure in a module. Static procedures for which the token is
already known to be held should assert that it is held instead of
acquiring it recursively.
-Matt
Matthew Dillon
<dillon@backplane.com>
[
Date Prev][
Date Next]
[
Thread Prev][
Thread Next]
[
Date Index][
Thread Index]