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 3F95DC433F5 for ; Fri, 28 Jan 2022 06:27:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B61016B007E; Fri, 28 Jan 2022 01:27:11 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B38676B0080; Fri, 28 Jan 2022 01:27:11 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A00E66B0081; Fri, 28 Jan 2022 01:27:11 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0147.hostedemail.com [216.40.44.147]) by kanga.kvack.org (Postfix) with ESMTP id 90B6D6B007E for ; Fri, 28 Jan 2022 01:27:11 -0500 (EST) Received: from smtpin31.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 52072181FA8CB for ; Fri, 28 Jan 2022 06:27:11 +0000 (UTC) X-FDA: 79078713462.31.E010235 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf26.hostedemail.com (Postfix) with ESMTP id D0150140002 for ; Fri, 28 Jan 2022 06:27:10 +0000 (UTC) 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 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: D0150140002 X-Stat-Signature: qj18bdao6q9ock45ge86afgrhg5m5uhx X-Rspam-User: nil Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b="iU+icda/"; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b="yL//OJyK"; spf=pass (imf26.hostedemail.com: domain of osalvador@suse.de designates 195.135.220.28 as permitted sender) smtp.mailfrom=osalvador@suse.de; dmarc=pass (policy=none) header.from=suse.de X-HE-Tag: 1643351230-288753 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 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