]> git.hungrycats.org Git - linux/commit
[PATCH] no buddy bitmap patch revisit: for mm/page_alloc.c
authorKamezawa Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Sat, 8 Jan 2005 06:01:35 +0000 (22:01 -0800)
committerLinus Torvalds <torvalds@evo.osdl.org>
Sat, 8 Jan 2005 06:01:35 +0000 (22:01 -0800)
commit69fba2dd0335abec0b0de9ac53d5bbb67c31fc60
tree08b2720d361c689047e7046931a16f1e4815cb3b
parent6951e82fe339eb35a7a0b8042eba9d015d79be55
[PATCH] no buddy bitmap patch revisit: for mm/page_alloc.c

This patch removes bitmaps from page allocator in mm/page_alloc.c.

This buddy system uses page->private field to record free page's order
instead of using bitmaps.

The algorithm of the buddy system is unchanged. Only bitmaps are removed.

In this buddy system, 2 pages,a page and "buddy", can be coalesced when

(buddy->private & PG_private) &&
(page_order(page)) == (page_order(buddy)) &&
!PageReserved(buddy) &&
page_count(buddy) == 0

this also means "buddy" is a head of continuous free pages
of length of (1 << page_order(buddy)).

bad_range() is called from inner loop of __free_pages_bulk().
In many archs, bad_range() is only a sanity check, it will always return 0.
But if a zone's memmap has a hole, it sometimes returns 1.
An architecture with memory holes in a zone has to define CONFIG_HOLES_IN_ZONE.
When CONFIG_HOLES_IN_ZONE is defined, pfn_valid() is called for checking
whether a buddy pages is valid or not.

Signed-off-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
mm/page_alloc.c