• Josh Aas's avatar
    [PATCH] improve speed of freeing bootmem · fe92ebf3
    Josh Aas authored
    Attached is a patch that greatly improves the speed of freeing boot memory.
     On ia64 machines with 2GB or more memory (I didn't test with less, but I
    can't imagine there being a problem), the speed improvement is about 75%
    for the function free_all_bootmem_core.  This translates to savings on the
    order of 1 minute / TB of memory during boot time.  That number comes from
    testing on a machine with 512GB, and extrapolating based on profiling of an
    unpatched 4TB machine.  For 4 and 8 TB machines, the time spent in this
    function is about 1 minutes/TB, which is painful especially given that
    there is no indication of what is going on put to the console (this issue
    to possibly be addressed later).
    
    The basic idea is to free higher order pages instead of going through every
    single one.  Also, some unnecessary atomic operations are done away with
    and replaced with non-atomic equivalents, and prefetching is done where it
    helps the most.  For a more in-depth discusion of this patch, please see
    the linux-ia64 archives (topic is "free bootmem feedback patch").
    
    The patch is originally Tony Luck's, and I added some further optimizations
    (non-atomic ops improvements and prefetching).
    Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
    Signed-off-by: default avatarJosh Aas <josha@sgi.com>
    Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
    fe92ebf3
bootmem.c 10.5 KB