• Ingo Molnar's avatar
    [PATCH] remove the BKL by turning it into a semaphore · fb8f6499
    Ingo Molnar authored
    This is the current remove-BKL patch.  I test-booted it on x86 and x64, trying
    every conceivable combination of SMP, PREEMPT and PREEMPT_BKL.  All other
    architectures should compile as well.  (most of the testing was done with the
    zaphod patch undone but it applies cleanly on vanilla -mm3 as well and should
    work fine.)
    
    this is the debugging-enabled variant of the patch which has two main
    debugging features:
    
     - debug potentially illegal smp_processor_id() use. Has caught a number
       of real bugs - e.g. look at the printk.c fix in the patch.
    
     - make it possible to enable/disable the BKL via a .config. If this 
       goes upstream we dont want this of course, but for now it gives
       people a chance to find out whether any particular problem was caused
       by this patch.
    
    This patch has one important fix over the previous BKL patch: on PREEMPT
    kernels if we preempted BKL-using code then the code still auto-dropped the
    BKL by mistake.  This caused a number of breakages for testers, which
    breakages went away once this bug was fixed.
    
    Also the debugging mechanism has been improved alot relative to the previous
    BKL patch.
    
    Would be nice to test-drive this in -mm.  There will likely be some more
    smp_processor_id() false positives but they are 1) harmless 2) easy to fix up.
    We could as well find more real smp_processor_id() related breakages as well.
    
    The most noteworthy fact is that no BKL-using code was found yet that relied
    on smp_processor_id(), which is promising from a compatibility POV.
    Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    fb8f6499
main.c 16.5 KB