Alan Cox says:
- The problem is people think of the BKL as a lock. It isn't a lock it has never been a lock and it's all DaveM's fault 8) for naming it that when he moved my asm entry point stuff into C. The BKL turns on old style unix non-pre-emptive sematics between all code that is within lock_kernel sections, that is it. That also makes it hard to clean up because lock_kernel is delimiting code properties (it's essentially almost a function attribute) and spin_lock/down/up and friends are real locks and lock data. I've seen very few cases where there is a magic transform from one to the other because of this. So if you want to kill the BKL add proper locking to data structures covered by BKL users until the lock_kernel simply does nothing. Fix the data structure locking starting at the lowest level is how I've always tackled these messes. When the low level locking is right the rest just works (usually 8)).
- "Lock data not code"
Alan
