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 C1DA0C433EF for ; Tue, 7 Dec 2021 11:09:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 09DA86B00B6; Tue, 7 Dec 2021 06:09:13 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 04CCB6B00B8; Tue, 7 Dec 2021 06:09:12 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E30246B00B9; Tue, 7 Dec 2021 06:09:12 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0204.hostedemail.com [216.40.44.204]) by kanga.kvack.org (Postfix) with ESMTP id D45DC6B00B6 for ; Tue, 7 Dec 2021 06:09:12 -0500 (EST) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 9A34F180DA184 for ; Tue, 7 Dec 2021 11:09:02 +0000 (UTC) X-FDA: 78890726124.27.A54DB70 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf03.hostedemail.com (Postfix) with ESMTP id 1DEDF2000B for ; Tue, 7 Dec 2021 11:09:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1638875341; h=from:from:reply-to:subject:subject: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=E4KlXKiWfB3WzLMuIAg4R7RSI2mbgseCbxor89QUgRs=; b=VgTor/Z+bDxyazAwE3NiHw5gp8GdUnG6u2qjanmWQDUyGGOPApIAwm9MECUqQ7Q0VOapTk YPMFWMLS3dnU1zZTxmI9HxIs0fNapJWyazIkC+0cSw+blYyh0HHZA5CgTEAuP0qleCh3+8 0AbTU4Jn/HM+6QCXwVzGppi44oExNgw= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-460-yt0qWxx3OE224_ntPnqGLg-1; Tue, 07 Dec 2021 06:09:00 -0500 X-MC-Unique: yt0qWxx3OE224_ntPnqGLg-1 Received: by mail-wr1-f70.google.com with SMTP id d3-20020adfa343000000b0018ed6dd4629so2833365wrb.2 for ; Tue, 07 Dec 2021 03:09:00 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent :content-language:to:cc:references:from:organization:subject :in-reply-to:content-transfer-encoding; bh=E4KlXKiWfB3WzLMuIAg4R7RSI2mbgseCbxor89QUgRs=; b=IqG5JXWOIDFk66Tyg6kohpM2V3dShuNQf4MelmzkMF591q66lWp5v5eyFstvh/7UlA 2vP4v+m94VxvR81GbzoxNSGCrvdRVYQWRzNVfwqYUNEMC8S23833zXLY4zXkjEfJRB+C YAKlib3aPOIFzvvY7JzMpRlF5l9jVTecDELGB3+x/QCc1YVyu7fE2A8npwa3tzbCRWXu mNKoZBgP0q/v5mWsDm5SEJQmg/R5H9wTniPVahwGDE66us09jXM3AHJM7s8zubL6s1y7 k0aGO6Cn1eLSRo2anD4AgHBxsbAaRTY2fiK1VqIhrDgH3ZngRCJm5tPLuMqjicnly68C VtzQ== X-Gm-Message-State: AOAM531/Eh2ABau492Le3E50rajGULKTQhpZNnlT32rh+StINdUwcqim Lz+Rzj7gkL/ySAXTQV7NSxQ6TmcgC/p58w4eIQmt2gQsXkCEjwXt5cVANuLujaMNLcuxXcnQBnv YGGu10RnN1Tc= X-Received: by 2002:adf:d1c1:: with SMTP id b1mr28284323wrd.204.1638875339381; Tue, 07 Dec 2021 03:08:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJxMhjIntNhbb6GmcmKPSnU3wgbIsO7E5txyyS/wn67qZyQO5XKttBSa05o8e2CXkMK4y5R0MA== X-Received: by 2002:adf:d1c1:: with SMTP id b1mr28284299wrd.204.1638875339141; Tue, 07 Dec 2021 03:08:59 -0800 (PST) Received: from [192.168.3.132] (p4ff23e57.dip0.t-ipconnect.de. [79.242.62.87]) by smtp.gmail.com with ESMTPSA id m9sm2529881wmq.1.2021.12.07.03.08.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Dec 2021 03:08:58 -0800 (PST) Message-ID: <1043a1a4-b7f2-8730-d192-7cab9f15ee24@redhat.com> Date: Tue, 7 Dec 2021 12:08:57 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 To: Michal Hocko , Alexey Makhalov Cc: Dennis Zhou , Eric Dumazet , "linux-mm@kvack.org" , Andrew Morton , Oscar Salvador , Tejun Heo , Christoph Lameter , "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" 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> From: David Hildenbrand Organization: Red Hat Subject: Re: [PATCH v3] mm: fix panic in __alloc_pages In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 1DEDF2000B Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b="VgTor/Z+"; spf=none (imf03.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Server: rspam04 X-Stat-Signature: 5cc7di7y77tdh4u8uig5f5uepjyrmapg X-HE-Tag: 1638875341-287275 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 07.12.21 11:54, Michal Hocko wrote: > 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); That's x86 specific and not exposed to generic code -- at least in my code base. I think we'd want an arch_alloc_nodedata() variant that allocates via memblock -- and initializes all fields to 0. So essentially a generic alloc_node_data(). > + free_area_init_memoryless_node(nid); That's really just free_area_init_node() below, I do wonder what value free_area_init_memoryless_node() has as of today. > + 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? > __build_all_zonelists() has to update the zonelists of all nodes I think. -- Thanks, David / dhildenb