public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH x86,mm]  fix pgt_buf_end when memory hotplug
@ 2011-09-08  9:33 Lai Jiangshan
  2011-09-08 15:21 ` Stefano Stabellini
  0 siblings, 1 reply; 3+ messages in thread
From: Lai Jiangshan @ 2011-09-08  9:33 UTC (permalink / raw)
  To: x86, linux-kernel
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, Tejun Heo,
	Yinghai Lu, Stephen Wilson


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");
 

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

* Re: [PATCH x86,mm]  fix pgt_buf_end when memory hotplug
  2011-09-08  9:33 [PATCH x86,mm] fix pgt_buf_end when memory hotplug Lai Jiangshan
@ 2011-09-08 15:21 ` Stefano Stabellini
  2011-09-21  5:51   ` Lai Jiangshan
  0 siblings, 1 reply; 3+ messages in thread
From: Stefano Stabellini @ 2011-09-08 15:21 UTC (permalink / raw)
  To: Lai Jiangshan
  Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Thomas Gleixner,
	Ingo Molnar, H. Peter Anvin, Tejun Heo, Yinghai Lu,
	Stephen Wilson

On Thu, 8 Sep 2011, Lai Jiangshan wrote:
> 
> When I test memory hotplug, such message is always outputted when hot-adding
> a memory block:
> 
> initial kernel pagetable allocation wasted ffffffffffffffff pages

I take you are using tip/x86/mm, because that is the only branch that
contains that warning.


> 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");


This patch makes sense to me. It would also make sense to print the
"allocation wasted" warning only if (!after_bootmem).

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

* Re: [PATCH x86,mm]  fix pgt_buf_end when memory hotplug
  2011-09-08 15:21 ` Stefano Stabellini
@ 2011-09-21  5:51   ` Lai Jiangshan
  0 siblings, 0 replies; 3+ messages in thread
From: Lai Jiangshan @ 2011-09-21  5:51 UTC (permalink / raw)
  To: Stefano Stabellini
  Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Thomas Gleixner,
	Ingo Molnar, H. Peter Anvin, Tejun Heo, Yinghai Lu,
	Stephen Wilson

On 09/08/2011 11:21 PM, Stefano Stabellini wrote:
> On Thu, 8 Sep 2011, Lai Jiangshan wrote:
>>
>> When I test memory hotplug, such message is always outputted when hot-adding
>> a memory block:
>>
>> initial kernel pagetable allocation wasted ffffffffffffffff pages
> 
> I take you are using tip/x86/mm, because that is the only branch that
> contains that warning.

No,
I was using tip/master.

Thanks,
Lai

> 
> 
>> 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");
> 
> 
> This patch makes sense to me. It would also make sense to print the
> "allocation wasted" warning only if (!after_bootmem).
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/
> 


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

end of thread, other threads:[~2011-09-21  5:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-08  9:33 [PATCH x86,mm] fix pgt_buf_end when memory hotplug Lai Jiangshan
2011-09-08 15:21 ` Stefano Stabellini
2011-09-21  5:51   ` Lai Jiangshan

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