public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Lai Jiangshan <laijs@cn.fujitsu.com>
To: x86@kernel.org, linux-kernel@vger.kernel.org
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	Tejun Heo <tj@kernel.org>, Yinghai Lu <yinghai@kernel.org>,
	Stephen Wilson <wilsons@start.ca>
Subject: [PATCH x86,mm]  fix pgt_buf_end when memory hotplug
Date: Thu, 08 Sep 2011 17:33:55 +0800	[thread overview]
Message-ID: <4E688C03.7080608@cn.fujitsu.com> (raw)


When I test memory hotplug, such message is always outputted when hot-adding
a memory block:

initial kernel pagetable allocation wasted ffffffffffffffff pages

This message comes from init_memory_mapping(), it shows "pgt_buf_end" is
incorrect here, and I found it was caused by alloc_low_page().

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
---
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c
index bbaaa00..e138e0a 100644
--- a/arch/x86/mm/init_64.c
+++ b/arch/x86/mm/init_64.c
@@ -317,7 +317,7 @@ void __init cleanup_highmap(void)
 
 static __ref void *alloc_low_page(unsigned long *phys)
 {
-	unsigned long pfn = pgt_buf_end++;
+	unsigned long pfn;
 	void *adr;
 
 	if (after_bootmem) {
@@ -327,6 +327,7 @@ static __ref void *alloc_low_page(unsigned long *phys)
 		return adr;
 	}
 
+	pfn = pgt_buf_end++;
 	if (pfn >= pgt_buf_top)
 		panic("alloc_low_page: ran out of memory");
 

             reply	other threads:[~2011-09-08  9:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-08  9:33 Lai Jiangshan [this message]
2011-09-08 15:21 ` [PATCH x86,mm] fix pgt_buf_end when memory hotplug Stefano Stabellini
2011-09-21  5:51   ` Lai Jiangshan

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=4E688C03.7080608@cn.fujitsu.com \
    --to=laijs@cn.fujitsu.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=tj@kernel.org \
    --cc=wilsons@start.ca \
    --cc=x86@kernel.org \
    --cc=yinghai@kernel.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