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 28CFDC433F5 for ; Tue, 7 Dec 2021 11:03:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4E9D96B00B4; Tue, 7 Dec 2021 06:03:10 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 4995F6B00B6; Tue, 7 Dec 2021 06:03:10 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3608C6B00B7; Tue, 7 Dec 2021 06:03:10 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay028.a.hostedemail.com [64.99.140.28]) by kanga.kvack.org (Postfix) with ESMTP id 29B5E6B00B4 for ; Tue, 7 Dec 2021 06:03:10 -0500 (EST) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 0D3FF2089F for ; Tue, 7 Dec 2021 10:54:37 +0000 (UTC) X-FDA: 78890689794.01.0217352 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf02.hostedemail.com (Postfix) with ESMTP id 90B2A80004 for ; Tue, 7 Dec 2021 10:54:36 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 78F6F212BE; Tue, 7 Dec 2021 10:54:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1638874475; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=n/VtBKAgGrOoJ9mlQUX4QcNZE7VUA2PWVux2aJmIsx4=; b=pX0oqqwAbTsF7GqTf4ROFm8RHUaNC6UZqlUn2IbCNmYDi3sLHAEYbiOwyJ29ZH2YTYpqXP ofRg6Z9wiaDV/9vwK9BbgKjExQysy6orOXfwW4zZWqkUuY0N/HY6yzYpX/nFKm1bMLDxUe Y/BiHkOJ2Gn04wAC41zC5cOsX+jmsYI= Received: from suse.cz (unknown [10.100.201.86]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id E997CA3B81; Tue, 7 Dec 2021 10:54:34 +0000 (UTC) Date: Tue, 7 Dec 2021 11:54:34 +0100 From: Michal Hocko To: Alexey Makhalov Cc: Dennis Zhou , Eric Dumazet , "linux-mm@kvack.org" , Andrew Morton , David Hildenbrand , Oscar Salvador , Tejun Heo , Christoph Lameter , "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" Subject: Re: [PATCH v3] mm: fix panic in __alloc_pages Message-ID: References: <908909e0-4815-b580-7ff5-d824d36a141c@redhat.com> <20211108202325.20304-1-amakhalov@vmware.com> <2e191db3-286f-90c6-bf96-3f89891e9926@gmail.com> <5239D699-523C-4F0C-923A-B068E476043E@vmware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Stat-Signature: ygpmtqxu9h3685ebdwoctt9bja6973u7 Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=suse.com header.s=susede1 header.b=pX0oqqwA; spf=pass (imf02.hostedemail.com: domain of mhocko@suse.com designates 195.135.220.28 as permitted sender) smtp.mailfrom=mhocko@suse.com; dmarc=pass (policy=quarantine) header.from=suse.com X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 90B2A80004 X-HE-Tag: 1638874476-248413 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: Hi, I didn't have much time to dive into this deeper and I have hit some problems handling this in an arch specific code so I have tried to play with this instead: diff --git a/mm/page_alloc.c b/mm/page_alloc.c index c5952749ad40..4d71759d0d9b 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -8032,8 +8032,16 @@ void __init free_area_init(unsigned long *max_zone_pfn) /* Initialise every node */ mminit_verify_pageflags_layout(); setup_nr_node_ids(); - for_each_online_node(nid) { + for_each_node(nid) { pg_data_t *pgdat = NODE_DATA(nid); + + if (!node_online(nid)) { + pr_warn("Node %d uninitialized by the platform. Please report with memory map.\n"); + alloc_node_data(nid); + free_area_init_memoryless_node(nid); + continue; + } + free_area_init_node(nid); /* Any memory on that node */ Could you give it a try? I do not have any machine which would exhibit the problem so I cannot really test this out. I hope build_zone_info will not choke on this. I assume the node distance table is uninitialized for these nodes and IIUC this should lead to an assumption that all other nodes are close. But who knows that can blow up there. Btw. does this make any sense at all to others? -- Michal Hocko SUSE Labs