mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Yinghai Lu" <yhlu.kernel@gmail.com>
To: "Andrew Morton" <akpm@linux-foundation.org>
Cc: mingo@elte.hu, clameter@sgi.com, linux-kernel@vger.kernel.org,
	"Andi Kleen" <ak@suse.de>,
	"Yasunori Goto" <y-goto@jp.fujitsu.com>,
	"KAMEZAWA Hiroyuki" <kamezawa.hiroyu@jp.fujitsu.com>
Subject: [PATCH] mm: make free_bootmem to loop bdata_list
Date: Thu, 13 Mar 2008 11:53:31 -0700	[thread overview]
Message-ID: <86802c440803131153m325c9e04h43bfd25b667a5c04@mail.gmail.com> (raw)

[-- 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)

             reply	other threads:[~2008-03-13 18:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-13 18:53 Yinghai Lu [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86802c440803131153m325c9e04h43bfd25b667a5c04@mail.gmail.com \
    --to=yhlu.kernel@gmail.com \
    --cc=ak@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=clameter@sgi.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=y-goto@jp.fujitsu.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®