From: Yinghai Lu <yinghai@kernel.org>
To: Tejun Heo <tj@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>, Ingo Molnar <mingo@elte.hu>,
"H. Peter Anvin" <hpa@zytor.com>,
David Rientjes <rientjes@google.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] x86, numa: exit early on numa_reset_distance()
Date: Wed, 16 Feb 2011 15:08:57 -0800 [thread overview]
Message-ID: <4D5C5909.4020405@kernel.org> (raw)
In-Reply-To: <20110216223943.GA29600@atj.dyndns.org>
On 02/16/2011 02:39 PM, Tejun Heo wrote:
> On Wed, Feb 16, 2011 at 12:56:47PM -0800, Yinghai Lu wrote:
>>
>> Do not call __pa(numa_distance), if it is not allocated before.
>>
>> it will get BUG_ON if VIRTUAL_DEBUG is on.
>>
>> Signed-off-by: Yinghai Lu <yinghai@kernel.org>
>
> Thanks for spotting this.
>
>> Index: linux-2.6/arch/x86/mm/numa_64.c
>> ===================================================================
>> --- linux-2.6.orig/arch/x86/mm/numa_64.c
>> +++ linux-2.6/arch/x86/mm/numa_64.c
>> @@ -371,6 +371,12 @@ static void __init numa_reset_distance(v
>> {
>> size_t size;
>>
>> + if (!numa_distance_cnt) {
>> + numa_distance = NULL;
>> +
>> + return;
>> + }
>> +
>
> But please move the existing numa_distance = NULL before the
> conditional and do if (!numa_distance_cnt) return;
confused. Do you mean this one ?
[PATCH -v2] x86, numa: exit early on numa_reset_distance()
Do not call __pa(numa_distance), if it is not allocated before.
it will get BUG_ON if VIRTUAL_DEBUG is on.
-v2: change to check existing path as tj requested.
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
---
arch/x86/mm/numa_64.c | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
Index: linux-2.6/arch/x86/mm/numa_64.c
===================================================================
--- linux-2.6.orig/arch/x86/mm/numa_64.c
+++ linux-2.6/arch/x86/mm/numa_64.c
@@ -371,11 +371,13 @@ static void __init numa_reset_distance(v
{
size_t size;
- size = numa_distance_cnt * sizeof(numa_distance[0]);
- memblock_x86_free_range(__pa(numa_distance),
- __pa(numa_distance) + size);
+ if (numa_distance_cnt) {
+ size = numa_distance_cnt * sizeof(numa_distance[0]);
+ memblock_x86_free_range(__pa(numa_distance),
+ __pa(numa_distance) + size);
+ numa_distance_cnt = 0;
+ }
numa_distance = NULL;
- numa_distance_cnt = 0;
}
/*
next prev parent reply other threads:[~2011-02-16 23:10 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-16 20:56 [PATCH] x86, numa: exit early on numa_reset_distance() Yinghai Lu
2011-02-16 20:57 ` [PATCH] x86, numa: seperate alloc_numa_distance from numa_reset_distance Yinghai Lu
2011-02-16 21:44 ` Cyrill Gorcunov
2011-02-16 22:29 ` Yinghai Lu
2011-02-16 22:47 ` Cyrill Gorcunov
2011-02-16 22:51 ` Tejun Heo
2011-02-16 20:58 ` [PATCH] x86, numa: refactoring numa_register_memblks Yinghai Lu
2011-02-16 22:43 ` Tejun Heo
2011-02-16 22:53 ` Yinghai Lu
2011-02-16 23:03 ` Tejun Heo
2011-02-16 22:30 ` [PATCH] x86, numa: put dummy_numa_init in init section Yinghai Lu
2011-02-16 22:44 ` Tejun Heo
[not found] ` <20110217130526.GB27911@elte.hu>
[not found] ` <20110217132435.GV19830@htj.dyndns.org>
[not found] ` <20110217135628.GB7018@elte.hu>
[not found] ` <4D5D48DA.6020908@kernel.org>
[not found] ` <20110217161649.GD14168@elte.hu>
2011-02-24 7:21 ` [PATCH -v2] x86: Rename e820_table_* to pgt_buf_* Yinghai Lu
2011-02-24 13:59 ` [PATCH] " Tejun Heo
2011-02-16 22:31 ` [PATCH] x86, numa: cleanup x86_acpi_numa_init() Yinghai Lu
2011-02-16 22:49 ` Tejun Heo
2011-02-16 22:55 ` Yinghai Lu
2011-02-16 22:39 ` [PATCH] x86, numa: exit early on numa_reset_distance() Tejun Heo
2011-02-16 23:08 ` Yinghai Lu [this message]
2011-02-16 23:15 ` Tejun Heo
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=4D5C5909.4020405@kernel.org \
--to=yinghai@kernel.org \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rientjes@google.com \
--cc=tglx@linutronix.de \
--cc=tj@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