]> git.hungrycats.org Git - linux/commit
[PATCH] improve speed of freeing bootmem
authorJosh Aas <josha@sgi.com>
Tue, 24 Aug 2004 04:26:54 +0000 (21:26 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Tue, 24 Aug 2004 04:26:54 +0000 (21:26 -0700)
commitfe92ebf3b40d54ba2a2ceb4806b07c654319133b
tree07b2323e45c3cba78f5695ca31601affdb021229
parent13c6195264e3f64a1bfbdad3dce78ef5fb431808
[PATCH] improve speed of freeing bootmem

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: Tony Luck <tony.luck@intel.com>
Signed-off-by: Josh Aas <josha@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
include/linux/page-flags.h
mm/bootmem.c