From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752273AbdLLGxG (ORCPT ); Tue, 12 Dec 2017 01:53:06 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:11932 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751999AbdLLGxD (ORCPT ); Tue, 12 Dec 2017 01:53:03 -0500 Message-ID: <5A2F7CAA.3070405@huawei.com> Date: Tue, 12 Dec 2017 14:52:26 +0800 From: zhong jiang User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:12.0) Gecko/20120428 Thunderbird/12.0.1 MIME-Version: 1.0 To: Michal Hocko CC: , , , , , , Subject: Re: [RESEND] x86/numa: move setting parsed numa node to num_add_memblk References: <1512123232-7263-1-git-send-email-zhongjiang@huawei.com> <20171211120304.GD4779@dhcp22.suse.cz> <5A2E8131.4000104@huawei.com> <20171211134539.GF4779@dhcp22.suse.cz> In-Reply-To: <20171211134539.GF4779@dhcp22.suse.cz> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.29.68] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090204.5A2F7CCB.0062,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: b2cd5f23dc3c00849d05da0ab04f6c91 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2017/12/11 21:45, Michal Hocko wrote: > On Mon 11-12-17 20:59:29, zhong jiang wrote: >> On 2017/12/11 20:03, Michal Hocko wrote: >>> On Fri 01-12-17 18:13:52, zhong jiang wrote: >>>> The acpi table are very much like user input. it is likely to >>>> introduce some unreasonable node in some architecture. but >>>> they do not ingore the node and bail out in time. it will result >>>> in unnecessary print. >>>> e.g x86: start is equal to end is a unreasonable node. >>>> numa_blk_memblk will fails but return 0. >>>> >>>> meanwhile, Arm64 node will double set it to "numa_node_parsed" >>>> after NUMA adds a memblk successfully. but X86 is not. because >>>> numa_add_memblk is not set in X86. >>> I am sorry but I still fail to understand wht the actual problem is. >>> You said that x86 will print a message. Alright at least you know that >>> the platform provides a nonsense ACPI/SRAT? tables and you can complain. >>> But does the kernel misbehave? In what way? >> From the view of the following code , we should expect that the node is reasonable. >> otherwise, if we only want to complain, it should bail out in time after printing the >> unreasonable message. >> >> node_set(node, numa_nodes_parsed); >> >> pr_info("SRAT: Node %u PXM %u [mem %#010Lx-%#010Lx]%s%s\n", >> node, pxm, >> (unsigned long long) start, (unsigned long long) end - 1, >> hotpluggable ? " hotplug" : "", >> ma->flags & ACPI_SRAT_MEM_NON_VOLATILE ? " non-volatile" : ""); >> >> /* Mark hotplug range in memblock. */ >> if (hotpluggable && memblock_mark_hotplug(start, ma->length)) >> pr_warn("SRAT: Failed to mark hotplug range [mem %#010Lx-%#010Lx] in memblock\n", >> (unsigned long long)start, (unsigned long long)end - 1); >> >> max_possible_pfn = max(max_possible_pfn, PFN_UP(end - 1)); >> >> return 0; >> out_err_bad_srat: >> bad_srat(); >> >> In addition. Arm64 will double set node to numa_nodes_parsed after add a memblk >> successfully. Because numa_add_memblk will perform node_set(*, *). >> >> if (numa_add_memblk(node, start, end) < 0) { >> pr_err("SRAT: Failed to add memblk to node %u [mem %#010Lx-%#010Lx]\n", >> node, (unsigned long long) start, >> (unsigned long long) end - 1); >> goto out_err_bad_srat; >> } >> >> node_set(node, numa_nodes_parsed); > I am sorry but I _do not_ understand how this answers my simple > question. You are describing the code flow which doesn't really explain > what is the _user_ or a _runtime_ visible effect. Anybody reading this > changelog will have to scratch his head to understand what the heck does > this fix and whether the patch needs to be considered for backporting. > See my point? There is not any visible effect to the user. IMO, it is a better optimization. Maybe I put more words to explain how the patch works. :-[ I found the code is messy when reading it without a real issue. Thanks zhong jiang