Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp1689474pxb; Sat, 29 Jan 2022 14:03:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJw62yF+LtLja81t6Pf7z3uY0tSHoTsFm1v8G09fVYEnYBdraUWCnG8G7SJ9FYj5XHzBrw1D X-Received: by 2002:a63:904c:: with SMTP id a73mr11503587pge.449.1643493836291; Sat, 29 Jan 2022 14:03:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643493836; cv=none; d=google.com; s=arc-20160816; b=k6b+/kbu5u/Xl+Ko1ChH+71t+weRP3y7M0b7whka7PLP0Jf8DqS00sIE1eU2IlfsIL jGar+epFAaZziB5+eeAwJ2Yvj9Yixu3mQVYjQj9GVNYT378yj4NThGaFTIMKPXkxnRPS mWTsCcnBwVNY/YNB4x+NM3YkbD7D5xKTCK8MjyCXV3AM7ao4YgGYEorcb97brWLZWJ5Y yjz0ps7VEvlTxEzLohbf3u0aN+9vi/sSMRaH+9Dxe0zme30Y0qpSCJJ0zQQQgNS8KOC/ SSwoAGfTDvEKnfvgkmPJSargfkBgbzWUAS6EGHhQqh00raWcXzBzi7eRm7k6iNj/tXaM 1LFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:message-id:user-agent :references:in-reply-to:subject:cc:to:from:date:mime-version :dkim-signature:dkim-signature; bh=FmcY6rQjztmhz8RTnKHfYdOR3tVFdDZGk/GHDzALr5I=; b=BcO0qSi+/0AfyKcyGLQDPoh+VCFeAtvbmVHngBJ351hR6FSXBcyZF54b27Se9IH+rc ovAYSBu0tR5xsNNeaL+5AnAEtB1eZGeel5D39Xb2kLDZunp5yMMwDdFpPWIY4mF1KRms QkMpUn2ug2e9EyW91IR0hsTitj2s0jTC0QYkw8NwMu1gM/0kKyFuu5GP8rY5XrjIRwQE cGAiWkSnXgP8Oi1OBZYvHQOMMypHHShcFlSRSun+Te6tV6i176rpbugjY+cKBJPaXjbY pWktD+KxZk922GrXpN/sISL6I7z+1JBa2M9/PxFuxQ/Ffq/d2nA76sEOSVEuqT45mHpO IYbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b="iU+icda/"; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; 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=NONE dis=NONE) header.from=suse.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m16si10621592pgu.404.2022.01.29.14.03.21; Sat, 29 Jan 2022 14:03:56 -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=@suse.de header.s=susede2_rsa header.b="iU+icda/"; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; 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=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346457AbiA1G1L (ORCPT + 99 others); Fri, 28 Jan 2022 01:27:11 -0500 Received: from smtp-out1.suse.de ([195.135.220.28]:59046 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242551AbiA1G1K (ORCPT ); Fri, 28 Jan 2022 01:27:10 -0500 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id A88BC21101; Fri, 28 Jan 2022 06:27:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1643351229; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FmcY6rQjztmhz8RTnKHfYdOR3tVFdDZGk/GHDzALr5I=; b=iU+icda/kGMAj3UGhqOh7R/tPdvoFLCyIdqJCRgX7bR/PA1BPycJtVPoETQh3t0Y1ssmZz iA5K1xlXRD+sEMUAVDAokG+yM6LJvEm1mtqxjSM2JYPfR7N7KZ+KHQzZv/J8yDOk34ksiX Y6awxU7AGeIbM3uJAHUG9hUZEv2eXwk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1643351229; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=FmcY6rQjztmhz8RTnKHfYdOR3tVFdDZGk/GHDzALr5I=; b=yL//OJyKBUc3yXZQY4ZhS6Gi1p6lEFwt+/8ft+wAxf8DG8nfTdqAnxJsD4nsWlUpxGk/wg KXjTrPjTIRaNQTAA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 973BB13780; Fri, 28 Jan 2022 06:27:09 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id Q+qlJL2M82ElMQAAMHmgww (envelope-from ); Fri, 28 Jan 2022 06:27:09 +0000 MIME-Version: 1.0 Date: Fri, 28 Jan 2022 07:27:09 +0100 From: Oscar Salvador To: Michal Hocko Cc: Andrew Morton , linux-mm@kvack.org, LKML , David Hildenbrand , Alexey Makhalov , Dennis Zhou , Eric Dumazet , Tejun Heo , Christoph Lameter , Nico Pache , Wei Yang , Rafael Aquini , Michal Hocko Subject: Re: [PATCH 2/6] mm: handle uninitialized numa nodes gracefully In-Reply-To: <20220127085305.20890-3-mhocko@kernel.org> References: <20220127085305.20890-1-mhocko@kernel.org> <20220127085305.20890-3-mhocko@kernel.org> User-Agent: Roundcube Webmail Message-ID: <97904ddc17553119fe97801ef5f9193d@suse.de> X-Sender: osalvador@suse.de Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2022-01-27 09:53, Michal Hocko wrote: > From: Michal Hocko > > We have had several reports [1][2][3] that page allocator blows up when > an allocation from a possible node is requested. The underlying reason > is that NODE_DATA for the specific node is not allocated. > > NUMA specific initialization is arch specific and it can vary a lot. > E.g. x86 tries to initialize all nodes that have some cpu affinity (see > init_cpu_to_node) but this can be insufficient because the node might > be > cpuless for example. > > One way to address this problem would be to check for !node_online > nodes > when trying to get a zonelist and silently fall back to another node. > That is unfortunately adding a branch into allocator hot path and it > doesn't handle any other potential NODE_DATA users. > > This patch takes a different approach (following a lead of [3]) and it > pre allocates pgdat for all possible nodes in an arch indipendent code > - free_area_init. All uninitialized nodes are treated as memoryless > nodes. node_state of the node is not changed because that would lead to > other side effects - e.g. sysfs representation of such a node and from > past discussions [4] it is known that some tools might have problems > digesting that. > > Newly allocated pgdat only gets a minimal initialization and the rest > of > the work is expected to be done by the memory hotplug - > hotadd_new_pgdat > (renamed to hotadd_init_pgdat). > > generic_alloc_nodedata is changed to use the memblock allocator because > neither page nor slab allocators are available at the stage when all > pgdats are allocated. Hotplug doesn't allocate pgdat anymore so we can > use the early boot allocator. The only arch specific implementation is > ia64 and that is changed to use the early allocator as well. > > Reported-by: Alexey Makhalov > Tested-by: Alexey Makhalov > Reported-by: Nico Pache > Acked-by: Rafael Aquini > Tested-by: Rafael Aquini > Signed-off-by: Michal Hocko With the mentioned fixups: Reviewed-by: Oscar Salvador -- Oscar Salvador SUSE Labs