linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Yasunori Goto <y-goto@jp.fujitsu.com>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-mm <linux-mm@kvack.org>,
	Linux Kernel ML <linux-kernel@vger.kernel.org>
Subject: [PATCH](memory hotplug) Fix unnecessary calling of init_currenty_empty_zone()
Date: Tue, 29 May 2007 18:47:32 +0900	[thread overview]
Message-ID: <20070529183819.159F.Y-GOTO@jp.fujitsu.com> (raw)

Hello.

This patch is to fix unnecessary calling of init_currently_empty_zone().

zone->present_pages is updated in online_pages(). But,
__add_zone() can be called twice or more before calling online_pages().
So, init_currenty_empty_zone() can be called unnecessary times.
It is cause of memory leak of zone's wait_table.

This patch is tested on my ia64 box with 2.6.22-rc2-mm1.

Signed-off-by: Yasunori Goto <y-goto@jp.fujitsu.com>

 mm/memory_hotplug.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

Index: vmemmap/mm/memory_hotplug.c
===================================================================
--- vmemmap.orig/mm/memory_hotplug.c	2007-05-29 15:30:28.000000000 +0900
+++ vmemmap/mm/memory_hotplug.c	2007-05-29 17:31:43.000000000 +0900
@@ -65,7 +65,7 @@ static int __add_zone(struct zone *zone,
 	int zone_type;
 
 	zone_type = zone - pgdat->node_zones;
-	if (!populated_zone(zone)) {
+	if (!zone->wait_table) {
 		int ret = 0;
 		ret = init_currently_empty_zone(zone, phys_start_pfn,
 						nr_pages, MEMMAP_HOTPLUG);

-- 
Yasunori Goto 


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

                 reply	other threads:[~2007-05-29  9:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20070529183819.159F.Y-GOTO@jp.fujitsu.com \
    --to=y-goto@jp.fujitsu.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /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