From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756523AbbHZHU5 (ORCPT ); Wed, 26 Aug 2015 03:20:57 -0400 Received: from cn.fujitsu.com ([59.151.112.132]:14072 "EHLO heian.cn.fujitsu.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1756476AbbHZHUz (ORCPT ); Wed, 26 Aug 2015 03:20:55 -0400 X-IronPort-AV: E=Sophos;i="5.15,520,1432569600"; d="scan'208";a="100031613" Message-ID: <55DD6877.6080709@cn.fujitsu.com> Date: Wed, 26 Aug 2015 15:19:19 +0800 From: Tang Chen User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.0 MIME-Version: 1.0 To: Xishi Qiu CC: Andrew Morton , Yasuaki Ishimatsu , Kamezawa Hiroyuki , , Linux MM , LKML , Yasuaki Ishimatsu Subject: Re: [PATCH 2/2] memory-hotplug: remove reset_node_managed_pages() and reset_node_managed_pages() in hotadd_new_pgdat() References: <55C9A3A9.5090300@huawei.com> <55C9A554.4090509@huawei.com> <55D9A036.7060506@cn.fujitsu.com> <55DAE113.20503@huawei.com> <55DAE666.5020302@cn.fujitsu.com> <55DAFEEB.4050601@huawei.com> In-Reply-To: <55DAFEEB.4050601@huawei.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 08/24/2015 07:24 PM, Xishi Qiu wrote: > ...... >>>> [ 2007.584000] On node 5 totalpages: 0 >>>> [ 2007.585000] Built 5 zonelists in Node order, mobility grouping on. Total pages: 32588823 >>>> [ 2007.594000] Policy zone: Normal >>>> [ 2007.598000] init_memory_mapping: [mem 0x60000000000-0x607ffffffff] >>>> >>>> >>>> And also, if we merge this patch, /sys/devices/system/node/nodeX/meminfo will break. >>>> >>> trigger call trace? >> No. There is no error output. But if you see /sys/devices/system/node/nodeX/meminfo, >> memory size will double because totalpages is calculated once here, and one more time >> when onlining memory. >> > Hi Tang, > > Do you mean si_meminfo_node() -> val->totalram = managed_pages; will be added double? > But my patch will keep it 0 in hotadd_new_pgdat(), so it will not be double, right? > Hi, I mean this: online_pages() |--> zone->zone_pgdat->node_present_pages += onlined_pages; It will be double. Since meminfo data is retrieved from these kernel structures, /proc/meminfo will be broken. Actually speaking, reset it when hot-adding memory is not a good idea. We should make the memory init code be suitable for both boot code and memory hot-plug code. Thanks.