Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1107702pxb; Tue, 1 Feb 2022 18:46:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJxD/pNsUw221BiS9aWfhvqpwxksSBaxctc42DIkatQb3irln2Onfg7rKc0uYLpI1O9JP9Or X-Received: by 2002:a17:907:7e8c:: with SMTP id qb12mr23031694ejc.539.1643769963142; Tue, 01 Feb 2022 18:46:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643769963; cv=none; d=google.com; s=arc-20160816; b=wnToV3BDozoV1aEc4bmBK1EL5ud373IPPS8OavF7XmcqdxpguRANSWPMcO6b81XPTG eJWc3rUt8/0qzU9Z9Op/+4FuCniOtIr0n1alU5FcpRo/yHl+Qk9515iLRw+RBwjLF0yH XIrRc4XKLKTpgj7ratAIWKOey3U1BdI0B/L80EQA2xBzZSsIlWDUDFVccoxWRO2xc9B0 2l0erIzxoRCd0z5HWuY/0HLbma3P/pvWePoXlJgztqVwHzKGFnlXN3cFcEJ0ytK2L6iH EI8CklMyM5h5EW8FMsYIeq11OUqRfDTuuhtRkSNXiFi4sbLWOkct33P2rWsHEb5ZcfU6 r/4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=JBboR6NMs3rfClr1WGtx+v5BC14P+XGf6fU8ruxde28=; b=n3nwAHIpbysVpcb6hvFlIr+rtZl5yUN3+qj5kjSUcpT7HLtmPP0/lFTknC+FAdB9Zo UrnilXdXfH8kncFKX4yfPvSAkpDd2pe6CEbviNUSyYbkj+RbDt3kbE/AqQIXQzkMwQut cz0BwXy04PHxzt3H3FFr9xQeCAEECIZSbLVmrJ8Rwb862DsKZ+0gQAWV6f647uJqPJI5 jkCMA7YR1zfWoMCN6UXi2fTF3Ks0+3E7FdXcXADHAIwnfK26GV7NIXf/02q2HVDjWMox soMAOmbFI4jVdzCyFAz6LSQ1foL39pFGtQqh5nJ+ULgjxgTsPuCyHhvdyamYZx2YlFOn Cm7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=eqLMZ9Tb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qf14si10679050ejc.108.2022.02.01.18.45.38; Tue, 01 Feb 2022 18:46:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=eqLMZ9Tb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232596AbiBAClX (ORCPT + 99 others); Mon, 31 Jan 2022 21:41:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232574AbiBAClW (ORCPT ); Mon, 31 Jan 2022 21:41:22 -0500 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B30EC061714 for ; Mon, 31 Jan 2022 18:41:22 -0800 (PST) Received: by mail-ej1-x62a.google.com with SMTP id o12so49214540eju.13 for ; Mon, 31 Jan 2022 18:41:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:reply-to:references:mime-version :content-disposition:in-reply-to:user-agent; bh=JBboR6NMs3rfClr1WGtx+v5BC14P+XGf6fU8ruxde28=; b=eqLMZ9TbfiCUCzLajbShK/Zaj2Qx7V7DjsdhPjGSfhMc5/ZAhy4U3MMW4vv9zS6C6v 979iyRc0PalLjoqBCnQ82krl15sSJROJvXN1tqj+vfesD8ulyizdA4+Ru7+4dvE9+q4A NJPChH/bo0h08TeX7pda7ywhAHWbV7Rdcm7OXEXn3wNHDqfg/Z4Y/NJ7wTnNLswDgmY7 eQsVIf6dZVyXcZs0eeZj8wGUvuBZf1hBbCWZOFGiqeYkMTpMO3Bjh1shA0e9K4sZtg0S 7DWKbfBDaeQePtDXrsZB2tIbiMhKxc04nQM0yHQxgBmdhu1H9/WcGs+iJGL77CirBo81 lUiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:reply-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=JBboR6NMs3rfClr1WGtx+v5BC14P+XGf6fU8ruxde28=; b=VG8FXDs9xbSD7o5ElJ4+fata7iQgJBvdxYlfMrecqyqsxPDmSfA/TEKDk206OSj1oR HhDgxuRX0gC7Z0KuEDnlNKrm9b6jwu5ayFstINaw+3q48W5Bl8bpfw7hMuKe/VniIhv4 6GYlRjRZ3BjdMRtkgSvzmOtz+GHn/gCRza6LakJwt85GFebSI8V16GkYVpZjT9tLg65t F9es3aU2sPNt6bDieSph03tJDrZ3funyk5Cl9Na1Lv08BsNj7mC16wI9s57i8cDNkXXK f4IfD/9WTSEIMHMdpRuKfGQtAhKdwHDccwcuELIOwyXcPzYpHFuN53gsYVTTepOF/b7g KOfQ== X-Gm-Message-State: AOAM530jfc8c/NBXeexpj9acdOtKDDD42OT9BiOba6TIAODN3oxt6qOa uPPBHESGi+Zs7txsOzeMH90= X-Received: by 2002:a17:906:7945:: with SMTP id l5mr19594805ejo.104.1643683280660; Mon, 31 Jan 2022 18:41:20 -0800 (PST) Received: from localhost ([185.92.221.13]) by smtp.gmail.com with ESMTPSA id e19sm12937073ejl.225.2022.01.31.18.41.20 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 31 Jan 2022 18:41:20 -0800 (PST) Date: Tue, 1 Feb 2022 02:41:19 +0000 From: Wei Yang To: Michal Hocko Cc: Mike Rapoport , Andrew Morton , linux-mm@kvack.org, LKML , David Hildenbrand , Alexey Makhalov , Dennis Zhou , Eric Dumazet , Oscar Salvador , Tejun Heo , Christoph Lameter , Nico Pache , Wei Yang , Rafael Aquini Subject: Re: [PATCH 2/6] mm: handle uninitialized numa nodes gracefully Message-ID: <20220201024119.2ailcw4rp5thambz@master> Reply-To: Wei Yang References: <20220127085305.20890-1-mhocko@kernel.org> <20220127085305.20890-3-mhocko@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 27, 2022 at 03:47:40PM +0100, Michal Hocko wrote: >[...] >> > + >> > + /* Allocator not initialized yet */ >> > + pgdat = arch_alloc_nodedata(nid); >> > + if (!pgdat) { >> > + pr_err("Cannot allocate %zuB for node %d.\n", >> > + sizeof(*pgdat), nid); >> > + continue; >> > + } >> > + arch_refresh_nodedata(nid, pgdat); >> > + free_area_init_memoryless_node(nid); free_area_init_memoryless_node() seems to be defined used out side page_alloc.c? It just call free_area_init_node() directly. We want to use the name to reflect the effect? >> > + /* >> > + * not marking this node online because we do not want to >> > + * confuse userspace by sysfs files/directories for node >> > + * without any memory attached to it (see topology_init) >> > + * The pgdat will get fully initialized when a memory is >> > + * hotpluged into it by hotadd_init_pgdat >> > + */ Hmm... which following step would mark the node online? On x86, the node is onlined in alloc_node_date(). This is not onlined here. >> > + continue; >> >> This can be made slightly more concise if we fall through after >> arch_refresh_nodedata(), e.g. something like >> >> ... >> >> arch_refresh_nodedata(nid, pgdat); >> } >> >> pgdat = NODE_DATA(nid); >> free_area_init_node(nid); >> >> /* >> * Do not mark memoryless node online because we do not want to >> * confuse userspace by sysfs files/directories for node >> * without any memory attached to it (see topology_init) >> * The pgdat will get fully initialized when a memory is >> * hotpluged into it by hotadd_init_pgdat >> */ >> if (!pgdat->node_present_pages) >> continue; >> >> but I don't feel strongly about it. > >I do not have strong preference either way. Unless this is considered >better by more people I would stick with what I have. I agree with Mike. >-- >Michal Hocko >SUSE Labs -- Wei Yang Help you, Help me