From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751931AbbCKCyM (ORCPT ); Tue, 10 Mar 2015 22:54:12 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:42896 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750914AbbCKCyI (ORCPT ); Tue, 10 Mar 2015 22:54:08 -0400 Message-ID: <54FFADB6.60604@huawei.com> Date: Wed, 11 Mar 2015 10:51:34 +0800 From: Xie XiuQi User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Gu Zheng , Xishi Qiu CC: Yasuaki Ishimatsu , Andrew Morton , Tang Chen , Yinghai Lu , Linux MM , LKML , Toshi Kani , Mel Gorman , Tejun Heo , Kamezawa Hiroyuki Subject: Re: node-hotplug: is memset 0 safe in try_offline_node()? References: <54F52ACF.4030103@huawei.com> <54F81322.8010202@cn.fujitsu.com> <54F8243D.7020809@huawei.com> <54FF9662.8080303@cn.fujitsu.com> In-Reply-To: <54FF9662.8080303@cn.fujitsu.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.17.191] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020206.54FFADC7.00C0,ss=1,re=0.001,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 855b6d3c02475b5bac27360141d803c2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2015/3/11 9:12, Gu Zheng wrote: > Hi Xishi, > > What is the condition of this problem now? Hi Gu, I have no machine to do this test now. But I've tested the patch "just remove memset 0" more than 20 hours last week, it's OK. Thanks, Xie XiuQi > > Regards, > Gu > On 03/05/2015 05:39 PM, Xishi Qiu wrote: > >> On 2015/3/5 16:26, Gu Zheng wrote: >> >>> Hi Xishi, >>> Could you please try the following one? >>> It postpones the reset of obsolete pgdat from try_offline_node() to >>> hotadd_new_pgdat(), and just resetting pgdat->nr_zones and >>> pgdat->classzone_idx to be 0 rather than the whole reset by memset() >>> as Kame suggested. >>> >>> Regards, >>> Gu >>> >>> --- >>> mm/memory_hotplug.c | 13 ++++--------- >>> 1 files changed, 4 insertions(+), 9 deletions(-) >>> >>> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c >>> index 1778628..c17eebf 100644 >>> --- a/mm/memory_hotplug.c >>> +++ b/mm/memory_hotplug.c >>> @@ -1092,6 +1092,10 @@ static pg_data_t __ref *hotadd_new_pgdat(int nid, u64 start) >>> return NULL; >>> >>> arch_refresh_nodedata(nid, pgdat); >>> + } else { >>> + /* Reset the nr_zones and classzone_idx to 0 before reuse */ >>> + pgdat->nr_zones = 0; >>> + pgdat->classzone_idx = 0; >> >> Hi Gu, >> >> This is just to avoid the warning, I think it's no meaning. >> Here is the changlog from the original patch: >> >> commit 88fdf75d1bb51d85ba00c466391770056d44bc03 >> ... >> Warn if memory-hotplug/boot code doesn't initialize pg_data_t with zero >> when it is allocated. Arch code and memory hotplug already initiailize >> pg_data_t. So this warning should never happen. I select fields *randomly* >> near the beginning, middle and end of pg_data_t for checking. >> ... >> >> Thanks, >> Xishi Qiu >> >>> } >>> >>> /* we can use NODE_DATA(nid) from here */ >>> @@ -2021,15 +2025,6 @@ void try_offline_node(int nid) >>> >>> /* notify that the node is down */ >>> call_node_notify(NODE_DOWN, (void *)(long)nid); >>> - >>> - /* >>> - * 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 >>> - * without reference counting or other symchronizing method, do not >>> - * reset node_data and free pgdat here. Just reset it to 0 and reuse >>> - * the memory when the node is online again. >>> - */ >>> - memset(pgdat, 0, sizeof(*pgdat)); >>> } >>> EXPORT_SYMBOL(try_offline_node); >>> >> >> >> >> -- >> 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: email@kvack.org >> . >> > > > -- > 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/ > > . >