the attached patch is a new approach to get rid of Linux's Big Kernel Lock as we know it today. The trick is to turn the BKL spinlock + depth counter into a special type of cpu-affine, recursive semaphore, which gets released by schedule() but not by preempt_schedule(). this gives the following advantages: - BKL critical sections are fully preemptable with this patch applied - there is no time wasted spinning on the BKL if there's BKL contention - no changes are needed for lock_kernel() users - the new semaphore-based approach is fully compatible with the BKL. code using lock_kernel()/unlock_kernel() will see very similar semantics as they got from the BKL, so correctness should be fully preserved. Per-CPU assumptions still work, locking exclusion and lock-recursion still works the same way as it did with the BKL. non-BKL code sees no overhead from this approach. (other than the slighly smaller code due to the uninlining of the BKL APIs.) (the patch is against vanilla 2.6.9-rc2. I have tested it on x86 UP+PREEMPT, UP+!PREEMPT, SMP+PREEMPT, SMP+!PREEMPT and x64 SMP+PREEMPT.) Ingo