Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp1625584ybh; Fri, 13 Mar 2020 04:39:52 -0700 (PDT) X-Google-Smtp-Source: ADFU+vshUIHX7DlH4EFTMZDvBso8Gnl2jv+aVY8IehE4FLrnHMybbID83Oo5E+DFR4jgQjQjvnfd X-Received: by 2002:a9d:6752:: with SMTP id w18mr10233081otm.123.1584099592829; Fri, 13 Mar 2020 04:39:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584099592; cv=none; d=google.com; s=arc-20160816; b=HrKC+GjoZsTPP0Fd2A4o9jPe6fAoulLHWjEJRgfvxsQB2usWyxTr/RVOMyPg0aQF5m CHNc3XmjXXKZz62ijbY3kU2chKkFJw6u5XtrTi1/bXcYecDkS4Dqj9Bgmuzyx9X0KEcM ulI4HSvez5ThXuOC5X01LGuI1IgzjQoqnh9QBqFxfIVKWsrhWGuFpdiOLzr5CWcczYhz sdv7HFrCd/yxy3LWcRyO5dbupjoDPTBe2iKQftKgmKuCnXFqyePPXDmXKIQbSqUWPOuL jAfaeiMhNH5/sJxd8QaZNU8JB7qrmU8EQQfbGNntONMHIZS2MLHCK7Pi0etYkrOjnQaC KVOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=lkMpwWX9ZPL/NLshDVMaEKt3fRT3CbnzSGaHe0DMizI=; b=gFkH3GXUMujce/ngfOxjftZx8MUGMNf/eFhw3EIThVZZZH43lZ4FQ49MyVwidKaRXD fWpbcygZenqwKRg2Rw7wKDLnKeTC9M90cc5yMuFqriDWE13k1arr5gnCwme7Kzw3lFAH mZrMRkJ55bp7IpLEZpgSdYGFcn+YJGTEGdQZQNm3LPO5GiXgL1hEsD0AyQUHUiQpxxlx ffIE6J48FDWQbxfJOENWfsurI7+NIlZ7C6OsmVj9aGNyxj3hB9xiYyQYv8gLQPna/X9Y oqoM6xsu6DHTcv84q6w92JCoZFtcB4JYtlyh/PhAxM22e0dmuhTVtavEQehWk63zFqQv FmZQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f15si4482849otp.314.2020.03.13.04.39.39; Fri, 13 Mar 2020 04:39:52 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726591AbgCMLis (ORCPT + 99 others); Fri, 13 Mar 2020 07:38:48 -0400 Received: from mx2.suse.de ([195.135.220.15]:47470 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726414AbgCMLis (ORCPT ); Fri, 13 Mar 2020 07:38:48 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id B13BBABEF; Fri, 13 Mar 2020 11:38:46 +0000 (UTC) Subject: Re: [PATCH 1/3] powerpc/numa: Set numa_node for all possible cpus To: Srikar Dronamraju , Joonsoo Kim Cc: Sachin Sant , Michal Hocko , Linus Torvalds , LKML , Linux Memory Management List , Mel Gorman , "Kirill A. Shutemov" , Andrew Morton , linuxppc-dev , Christopher Lameter , Joonsoo Kim , Kirill Tkhai , Michael Ellerman References: <20200311110237.5731-2-srikar@linux.vnet.ibm.com> <20200311115735.GM23944@dhcp22.suse.cz> <20200312052707.GA3277@linux.vnet.ibm.com> <5e5c736a-a88c-7c76-fc3d-7bc765e8dcba@suse.cz> <20200312131438.GB3277@linux.vnet.ibm.com> <61437352-8b54-38fa-4471-044a65c9d05a@suse.cz> <20200312161310.GC3277@linux.vnet.ibm.com> <20200313110440.GA25144@linux.vnet.ibm.com> From: Vlastimil Babka Message-ID: <06be5908-9af6-2892-0333-e9558b2cf474@suse.cz> Date: Fri, 13 Mar 2020 12:38:45 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <20200313110440.GA25144@linux.vnet.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/13/20 12:04 PM, Srikar Dronamraju wrote: >> I lost all the memory about it. :) >> Anyway, how about this? >> >> 1. make node_present_pages() safer >> static inline node_present_pages(nid) >> { >> if (!node_online(nid)) return 0; >> return (NODE_DATA(nid)->node_present_pages); >> } >> > > Yes this would help. Looks good, yeah. >> 2. make node_to_mem_node() safer for all cases >> In ppc arch's mem_topology_setup(void) >> for_each_present_cpu(cpu) { >> numa_setup_cpu(cpu); >> mem_node = node_to_mem_node(numa_mem_id()); >> if (!node_present_pages(mem_node)) { >> _node_numa_mem_[numa_mem_id()] = first_online_node; >> } >> } >> > > But here as discussed above, we miss the case of possible but not present nodes. > For such nodes, the above change may not update, resulting in they still > having 0. And node 0 can be only possible but not present. So is there other way to do the setup so that node_to_mem_node() returns an online+present node when called for any possible node?