From: AceVest Date: Sat, 5 Apr 2014 15:40:41 +0000 (+0800) Subject: fix bug in alloc pages X-Git-Tag: 0.3.0~85 X-Git-Url: http://zhaoyanbai.com/repos/%22http:/www.isc.org/icons/soc.html?a=commitdiff_plain;h=ff978ebd3d09c8dad3d24089dc9207ef3d9624c7;p=kernel.git fix bug in alloc pages --- diff --git a/mm/buddy.c b/mm/buddy.c index 1ce579f..934c7f4 100644 --- a/mm/buddy.c +++ b/mm/buddy.c @@ -62,7 +62,7 @@ found: size = 1UL << select_order; buddy = page + size; - list_add(&(page->lru), &(area->free_list)); + list_add(&(buddy->lru), &(area->free_list)); area->free_count++; buddy->private = select_order; SetPagePrivate(buddy); @@ -150,6 +150,13 @@ void dump_buddy_system() } + printk("alloc 1 pages va 0x%08x\n", alloc_pages(0, 0)); + printk("alloc 1 pages va 0x%08x\n", alloc_pages(0, 0)); + printk("alloc 1 pages va 0x%08x\n", alloc_pages(0, 0)); + printk("alloc 1 pages va 0x%08x\n", alloc_pages(0, 0)); + printk("alloc 1 pages va 0x%08x\n", alloc_pages(0, 0)); + printk("alloc 1 pages va 0x%08x\n", alloc_pages(0, 0)); + printk("alloc 1 pages va 0x%08x\n", alloc_pages(0, 0)); printk("alloc 1 pages va 0x%08x\n", alloc_pages(0, 0)); printk("alloc 1 pages va 0x%08x\n", alloc_pages(0, 0)); printk("alloc 2 pages va 0x%08x\n", alloc_pages(0, 1));