public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mm: make free_bootmem to loop bdata_list
@ 2008-03-13 18:53 Yinghai Lu
  2008-03-13 19:05 ` Andrew Morton
  2008-03-14  1:39 ` KAMEZAWA Hiroyuki
  0 siblings, 2 replies; 7+ messages in thread
From: Yinghai Lu @ 2008-03-13 18:53 UTC (permalink / raw)
  To: Andrew Morton
  Cc: mingo, clameter, linux-kernel, Andi Kleen, Yasunori Goto,
	KAMEZAWA Hiroyuki

[-- Attachment #1: Type: text/plain, Size: 381 bytes --]

[PATCH] mm: make free_bootmem to loop bdata_list

        [PATCH] mm: fix boundary checking in free_bootmem_core

make the free_bootmem_core could handle out of range case. we could use
bdata_list to make sure the range can be freed for sure.

so next time, we don't need to loop online nodes and could use
free_bootmem directly.

Signed-off-by: Yinghai Lu <yhlu.kernel@gmail.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: free_bootmem_loop_x.patch --]
[-- Type: text/x-patch; name=free_bootmem_loop_x.patch, Size: 507 bytes --]

Index: linux-2.6/mm/bootmem.c
===================================================================
--- linux-2.6.orig/mm/bootmem.c
+++ linux-2.6/mm/bootmem.c
@@ -427,7 +438,9 @@ int __init reserve_bootmem(unsigned long
 
 void __init free_bootmem(unsigned long addr, unsigned long size)
 {
-	free_bootmem_core(NODE_DATA(0)->bdata, addr, size);
+	bootmem_data_t *bdata;
+	list_for_each_entry(bdata, &bdata_list, list)
+		free_bootmem_core(bdata, addr, size);
 }
 
 unsigned long __init free_all_bootmem(void)

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-03-14  2:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-13 18:53 [PATCH] mm: make free_bootmem to loop bdata_list Yinghai Lu
2008-03-13 19:05 ` Andrew Morton
2008-03-13 19:10   ` Yinghai Lu
2008-03-14  1:39 ` KAMEZAWA Hiroyuki
2008-03-14  1:39   ` Yinghai Lu
2008-03-14  2:04     ` KAMEZAWA Hiroyuki
2008-03-14  2:07       ` Yinghai Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox