From 79e626e1d10916241f200066e9216380afca86bb Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Sat, 12 Apr 2003 12:57:13 -0700 Subject: [PATCH] bootmem speedup from the IA64 tree From: Christoph Hellwig This patch is from the IA64 tree, with some minor cleanups by me. David described it as: This is a performance speed up and some minor indendation fixups. The problem is that the bootmem code is (a) hugely slow and (b) has execution that grow quadratically with the size of the bootmap bitmap. This causes noticable slowdowns, especially on machines with (relatively) large holes in the physical memory map. Issue (b) is addressed by maintaining the "last_success" cache, so that we start the next search from the place where we last found some memory (this part of the patch could stand additional reviewing/testing). Issue (a) is addressed by using find_next_zero_bit() instead of the slow bit-by-bit testing. --- include/linux/bootmem.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/linux') diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h index 782041f43326..6902724691d2 100644 --- a/include/linux/bootmem.h +++ b/include/linux/bootmem.h @@ -32,6 +32,8 @@ typedef struct bootmem_data { void *node_bootmem_map; unsigned long last_offset; unsigned long last_pos; + unsigned long last_success; /* Previous allocation point. To speed + * up searching */ } bootmem_data_t; extern unsigned long __init bootmem_bootmap_pages (unsigned long); -- cgit v1.2.3