From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 99594C433EF for ; Tue, 1 Feb 2022 02:41:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DC5648D004E; Mon, 31 Jan 2022 21:41:22 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D72988D0028; Mon, 31 Jan 2022 21:41:22 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C138D8D004E; Mon, 31 Jan 2022 21:41:22 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0186.hostedemail.com [216.40.44.186]) by kanga.kvack.org (Postfix) with ESMTP id B1D268D0028 for ; Mon, 31 Jan 2022 21:41:22 -0500 (EST) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 605C4181CA342 for ; Tue, 1 Feb 2022 02:41:22 +0000 (UTC) X-FDA: 79092659604.07.501F2F4 Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) by imf04.hostedemail.com (Postfix) with ESMTP id F0A7C40006 for ; Tue, 1 Feb 2022 02:41:21 +0000 (UTC) Received: by mail-ej1-f45.google.com with SMTP id k25so48966316ejp.5 for ; Mon, 31 Jan 2022 18:41:21 -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=16i2QpjzdvUr+XGGdHgWUfxoon0jn7Dj0uZm8NcXp0b/8hkoTFn4D2SRQDfDl5VGFb pRFDhJV1IurbW1YzDPS+OwAKgi5x0NxChHvLU3KBEqoLsrAg3YnS1fYatjWN36zgNUmV rYLxAY9OFD9bQ5R+10KtlJZNL1Hjkp1j+Kyqq6c8rSrlEwb56iwvOScwef0o2vrb2W1x xb779GE3A7Wv6vS2b2XWDj50PDXFZIiF+3WXwHjAG28f66eCmCd6F8Gsp3S81FA4FPZz x7MAjZ0VBdElRosBuZbl5yPZQ+ItkCwzGfk2fTHvgO4CD8SFreKPNmgEFcP6zJobuqP2 3/zw== X-Gm-Message-State: AOAM530Jgd/YcuVV6TgwPOS6fDhJ0bJ4/LAFotnThmVDUlLx5TiZ/5+X 9RZFxk+xM4B681bKM/WXyPg= X-Google-Smtp-Source: ABdhPJxUm2mRvsCAG6hyhgD9bxBygoYt1vckh9c/7kCKF+FloEXzbFo6u6ytKjWl4DrxibuhVfiQjg== 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) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=eqLMZ9Tb; spf=pass (imf04.hostedemail.com: domain of richard.weiyang@gmail.com designates 209.85.218.45 as permitted sender) smtp.mailfrom=richard.weiyang@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspam-User: nil X-Rspamd-Queue-Id: F0A7C40006 X-Stat-Signature: dutzbnjnho7fsonhn4fwxuq95rozycai X-Rspamd-Server: rspam12 X-HE-Tag: 1643683281-161547 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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