From: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
To: Toshi Kani <toshi.kani@hp.com>
Cc: akpm@linux-foundation.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, zhenzhang.zhang@huawei.com,
wangnan0@huawei.com, tangchen@cn.fujitsu.com,
dave.hansen@intel.com, rientjes@google.com
Subject: Re: [PATCH] memory-hotplug: Clear pgdat which is allocated by bootmem in try_offline_node()
Date: Wed, 22 Oct 2014 14:32:28 +0900 [thread overview]
Message-ID: <5447416C.5080106@jp.fujitsu.com> (raw)
In-Reply-To: <1413910581.12798.25.camel@misato.fc.hp.com>
(2014/10/22 1:56), Toshi Kani wrote:
> On Mon, 2014-10-20 at 19:05 +0900, Yasuaki Ishimatsu wrote:
> :
>> When hot removing memory, pgdat is set to 0 in try_offline_node().
>> But if the pgdat is allocated by bootmem allocator, the clearing
>> step is skipped. And when hot adding the same memory, the uninitialized
>> pgdat is reused. But free_area_init_node() chacks wether pgdat is set
>
> s/chacks/checks
I'll update it.
>
>
>> to zero. As a result, free_area_init_node() hits WARN_ON().
>>
>> This patch clears pgdat which is allocated by bootmem allocator
>> in try_offline_node().
>>
>> Signed-off-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
>> CC: Zhang Zhen <zhenzhang.zhang@huawei.com>
>> CC: Wang Nan <wangnan0@huawei.com>
>> CC: Tang Chen <tangchen@cn.fujitsu.com>
>> CC: Toshi Kani <toshi.kani@hp.com>
>> CC: Dave Hansen <dave.hansen@intel.com>
>> CC: David Rientjes <rientjes@google.com>
>>
>> ---
>> mm/memory_hotplug.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
>> index 29d8693..7649f7c 100644
>> --- a/mm/memory_hotplug.c
>> +++ b/mm/memory_hotplug.c
>> @@ -1943,7 +1943,7 @@ void try_offline_node(int nid)
>>
>> if (!PageSlab(pgdat_page) && !PageCompound(pgdat_page))
>> /* node data is allocated from boot memory */
>> - return;
>> + goto out;
>
> Do we still need this if-statement? That is, do we have to skip the
> for-loop below even though it checks with is_vmalloc_addr()?
You are right. The if-statement is not necessary. So the issue can be
fixed by just removing the if-statement.
I'll post updated patch soon.
Thanks,
Yasuaki Ishimatsu
>
> Thanks,
> -Toshi
>
>
>> /* free waittable in each zone */
>> for (i = 0; i < MAX_NR_ZONES; i++) {
>> @@ -1957,6 +1957,7 @@ void try_offline_node(int nid)
>> vfree(zone->wait_table);
>> }
>>
>> +out:
>> /*
>> * Since there is no way to guarentee the address of pgdat/zone is not
>> * on stack of any kernel threads or used by other kernel objects
>
>
--
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>
WARNING: multiple messages have this Message-ID (diff)
From: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
To: Toshi Kani <toshi.kani@hp.com>
Cc: <akpm@linux-foundation.org>, <linux-mm@kvack.org>,
<linux-kernel@vger.kernel.org>, <zhenzhang.zhang@huawei.com>,
<wangnan0@huawei.com>, <tangchen@cn.fujitsu.com>,
<dave.hansen@intel.com>, <rientjes@google.com>
Subject: Re: [PATCH] memory-hotplug: Clear pgdat which is allocated by bootmem in try_offline_node()
Date: Wed, 22 Oct 2014 14:32:28 +0900 [thread overview]
Message-ID: <5447416C.5080106@jp.fujitsu.com> (raw)
In-Reply-To: <1413910581.12798.25.camel@misato.fc.hp.com>
(2014/10/22 1:56), Toshi Kani wrote:
> On Mon, 2014-10-20 at 19:05 +0900, Yasuaki Ishimatsu wrote:
> :
>> When hot removing memory, pgdat is set to 0 in try_offline_node().
>> But if the pgdat is allocated by bootmem allocator, the clearing
>> step is skipped. And when hot adding the same memory, the uninitialized
>> pgdat is reused. But free_area_init_node() chacks wether pgdat is set
>
> s/chacks/checks
I'll update it.
>
>
>> to zero. As a result, free_area_init_node() hits WARN_ON().
>>
>> This patch clears pgdat which is allocated by bootmem allocator
>> in try_offline_node().
>>
>> Signed-off-by: Yasuaki Ishimatsu <isimatu.yasuaki@jp.fujitsu.com>
>> CC: Zhang Zhen <zhenzhang.zhang@huawei.com>
>> CC: Wang Nan <wangnan0@huawei.com>
>> CC: Tang Chen <tangchen@cn.fujitsu.com>
>> CC: Toshi Kani <toshi.kani@hp.com>
>> CC: Dave Hansen <dave.hansen@intel.com>
>> CC: David Rientjes <rientjes@google.com>
>>
>> ---
>> mm/memory_hotplug.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
>> index 29d8693..7649f7c 100644
>> --- a/mm/memory_hotplug.c
>> +++ b/mm/memory_hotplug.c
>> @@ -1943,7 +1943,7 @@ void try_offline_node(int nid)
>>
>> if (!PageSlab(pgdat_page) && !PageCompound(pgdat_page))
>> /* node data is allocated from boot memory */
>> - return;
>> + goto out;
>
> Do we still need this if-statement? That is, do we have to skip the
> for-loop below even though it checks with is_vmalloc_addr()?
You are right. The if-statement is not necessary. So the issue can be
fixed by just removing the if-statement.
I'll post updated patch soon.
Thanks,
Yasuaki Ishimatsu
>
> Thanks,
> -Toshi
>
>
>> /* free waittable in each zone */
>> for (i = 0; i < MAX_NR_ZONES; i++) {
>> @@ -1957,6 +1957,7 @@ void try_offline_node(int nid)
>> vfree(zone->wait_table);
>> }
>>
>> +out:
>> /*
>> * Since there is no way to guarentee the address of pgdat/zone is not
>> * on stack of any kernel threads or used by other kernel objects
>
>
next prev parent reply other threads:[~2014-10-22 5:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-20 10:05 [PATCH] memory-hotplug: Clear pgdat which is allocated by bootmem in try_offline_node() Yasuaki Ishimatsu
2014-10-20 10:05 ` Yasuaki Ishimatsu
2014-10-21 16:56 ` Toshi Kani
2014-10-21 16:56 ` Toshi Kani
2014-10-22 5:32 ` Yasuaki Ishimatsu [this message]
2014-10-22 5:32 ` Yasuaki Ishimatsu
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=5447416C.5080106@jp.fujitsu.com \
--to=isimatu.yasuaki@jp.fujitsu.com \
--cc=akpm@linux-foundation.org \
--cc=dave.hansen@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=rientjes@google.com \
--cc=tangchen@cn.fujitsu.com \
--cc=toshi.kani@hp.com \
--cc=wangnan0@huawei.com \
--cc=zhenzhang.zhang@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.