• Pekka Enberg's avatar
    SLUB: dynamic per-cache MIN_PARTIAL · 5595cffc
    Pekka Enberg authored
    This patch changes the static MIN_PARTIAL to a dynamic per-cache ->min_partial
    value that is calculated from object size. The bigger the object size, the more
    pages we keep on the partial list.
    
    I tested SLAB, SLUB, and SLUB with this patch on Jens Axboe's 'netio' example
    script of the fio benchmarking tool. The script stresses the networking
    subsystem which should also give a fairly good beating of kmalloc() et al.
    
    To run the test yourself, first clone the fio repository:
    
      git clone git://git.kernel.dk/fio.git
    
    and then run the following command n times on your machine:
    
      time ./fio examples/netio
    
    The results on my 2-way 64-bit x86 machine are as follows:
    
      [ the minimum, maximum, and average are captured from 50 individual runs ]
    
                     real time (seconds)
                     min      max      avg      sd
      SLAB           22.76    23.38    22.98    0.17
      SLUB           22.80    25.78    23.46    0.72
      SLUB (dynamic) 22.74    23.54    23.00    0.20
    
       ...
    5595cffc
slub.c 105 KB