• Andrew Morton's avatar
    [PATCH] add L1_CACHE_SHIFT_MAX · f9da78fb
    Andrew Morton authored
    zone->lock and zone->lru_lock are two of the hottest locks in the
    kernel.  Their usage patterns are quite independent.  And they have
    just been put into the same structure.  It is essential that they not
    fall into the same cacheline.
    
    That could be fixed by padding with L1_CACHE_BYTES.  But the problem
    with this is that a kernel which was configured for (say) a PIII will
    perform poorly on SMP PIV.  This will cause problems for kernel
    vendors.  For example, RH currently ship PII and Athlon binaries.  To
    get best SMP performance they will end up needing to ship a lot of
    differently configured kernels.
    
    To solve this we need to know, at compile time, the maximum L1 size
    which this kernel will ever run on.
    
    This patch adds L1_CACHE_SHIFT_MAX to every architecture's cache.h.
    
    Of course it'll break when newer chips come out with increased
    cacheline sizes.   Better suggestions are welcome.
    f9da78fb
cache.h 1.28 KB