• Andrew Morton's avatar
    [PATCH] percpu_counters: approximate but scalable counters · ba8e8755
    Andrew Morton authored
    Several places in ext2 and ext3 are using filesystem-wide counters which use
    global locking.  Mainly for the orlov allocator's heuristics.
    
    To solve the contention which this causes we can trade off accuracy against
    speed.
    
    This patch introduces a "percpu_counter" library type in which the counts are
    per-cpu and are periodically spilled into a global counter.  Readers only
    read the global counter.
    
    These objects are *large*.  On a 32 CPU P4, they are 4 kbytes.  On a 4 way
    p3, 128 bytes.
    ba8e8755
percpu_counter.h 1.88 KB