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 240AAC433FE for ; Tue, 7 Dec 2021 15:10:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 277686B0096; Tue, 7 Dec 2021 10:09:57 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 226CF6B0098; Tue, 7 Dec 2021 10:09:57 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0C8D06B0099; Tue, 7 Dec 2021 10:09:57 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0097.hostedemail.com [216.40.44.97]) by kanga.kvack.org (Postfix) with ESMTP id EEEB86B0096 for ; Tue, 7 Dec 2021 10:09:56 -0500 (EST) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id AF453181AC212 for ; Tue, 7 Dec 2021 15:09:46 +0000 (UTC) X-FDA: 78891332772.03.88206D2 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf02.hostedemail.com (Postfix) with ESMTP id 2546D80008 for ; Tue, 7 Dec 2021 15:09:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1638889784; 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=R245khe8xk07RNyH0EVz6ZGFqepWH2fvgXb9UQjIJSY=; b=GvjHahqMhJwrAdnHAIlB7FyjoSdYqF80y4iJqS04tE60b59eaSDxj5TWNPk9+i9zmWd0EQ 5e+6dKUUpDb0Pq7WgQJOzEurmIaEujdtLLQMEwXwBkP9n4M3E45INoVn1okYxrx70rjZ9T mu6zrcHyghstC47uU8V2Xa9APFM81gQ= 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-565-RNkyGSUvO7qgc8EIzqOVHA-1; Tue, 07 Dec 2021 10:09:42 -0500 X-MC-Unique: RNkyGSUvO7qgc8EIzqOVHA-1 Received: by mail-wr1-f70.google.com with SMTP id q17-20020adfcd91000000b0017bcb12ad4fso3059841wrj.12 for ; Tue, 07 Dec 2021 07:09:42 -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:subject :content-language:to:cc:references:from:organization:in-reply-to :content-transfer-encoding; bh=R245khe8xk07RNyH0EVz6ZGFqepWH2fvgXb9UQjIJSY=; b=BOTk9SWGkvuOevwMMt2AR5fCq6IG+Tbv7TykfFwiMxAsYfMpl48dpFq202DQZ8fxTX wfQUSMTxHMpGB6RU8RPOwQlQKCy7CchtRI8bX5WQMCiMoWoYqshW0wW6TSFwyvbSwmIv m+Up9UgtP0RuyTGtlpzJWItAMs89o202g7OHoTiV5a26tj6IhIt9MYEKY2ez5UohQ/cN 4vNkr0nHHUKt+ZHQxY4SvrVSq7IyGv1CI9oEdcIaSQGmaRilM1V6ubhZlZ1c2Gp0cTUn DTBvy0yphGGRSUARxlMH3EiLDL/AK30jVc31QCxbcaKyhPYrLz+KjKUOjd4bmWZ88ywn bH/w== X-Gm-Message-State: AOAM532rrw2XZTxTE2L/rtIKAfwdTmgwdPKLUJfv3ZpaYnWcvpHo98Z8 S/56wlnvaKd+aE/36zQuYpRXKaH/zUWp3chiDSat0dxFQFsT9X5MZgzfsEIH7NzY3leaIQrH6CV EjrIkEoN9n0U= X-Received: by 2002:adf:df0b:: with SMTP id y11mr50895485wrl.181.1638889781581; Tue, 07 Dec 2021 07:09:41 -0800 (PST) X-Google-Smtp-Source: ABdhPJzXXWyseqL9/W2Gvac7QFnbIgZaUx6fF5pn8ANZ1qKu/BbVDPYxGE2dYV1lAqjltt8gZjUXuw== X-Received: by 2002:adf:df0b:: with SMTP id y11mr50895445wrl.181.1638889781333; Tue, 07 Dec 2021 07:09:41 -0800 (PST) Received: from [192.168.3.132] (p4ff23e57.dip0.t-ipconnect.de. [79.242.62.87]) by smtp.gmail.com with ESMTPSA id m17sm14723297wrz.22.2021.12.07.07.09.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Dec 2021 07:09:40 -0800 (PST) Message-ID: <77e785e6-cf34-0cff-26a5-852d3786a9b8@redhat.com> Date: Tue, 7 Dec 2021 16:09:39 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: [PATCH v3] mm: fix panic in __alloc_pages To: Michal Hocko Cc: Alexey Makhalov , 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: <5239D699-523C-4F0C-923A-B068E476043E@vmware.com> <1043a1a4-b7f2-8730-d192-7cab9f15ee24@redhat.com> From: David Hildenbrand Organization: Red Hat 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-Stat-Signature: qb8bwrmfo4b98hfhmfiu6gxjpxwyzxrr Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=GvjHahqM; spf=none (imf02.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 170.10.129.124) smtp.mailfrom=david@redhat.com; dmarc=pass (policy=none) header.from=redhat.com X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 2546D80008 X-HE-Tag: 1638889785-116252 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 14:23, Michal Hocko wrote: > On Tue 07-12-21 13:28:31, David Hildenbrand wrote: > [...] >> But maybe I am missing something important regarding online vs. offline >> nodes that your patch changes? > > I am relying on alloc_node_data setting the node online. But if we are > to change the call to arch_alloc_node_data then the patch needs to be > more involved. Here is what I have right now. If this happens to be the > right way then there is some additional work to sync up with the hotplug > code. > > diff --git a/mm/page_alloc.c b/mm/page_alloc.c > index c5952749ad40..a296e934ad2f 100644 > --- a/mm/page_alloc.c > +++ b/mm/page_alloc.c > @@ -8032,8 +8032,23 @@ 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) { > - pg_data_t *pgdat = NODE_DATA(nid); > + for_each_node(nid) { > + pg_data_t *pgdat; > + > + if (!node_online(nid)) { > + pr_warn("Node %d uninitialized by the platform. Please report with memory map.\n", nid); > + pgdat = arch_alloc_nodedata(nid); > + pgdat->per_cpu_nodestats = alloc_percpu(struct per_cpu_nodestat); > + arch_refresh_nodedata(nid, pgdat); > + node_set_online(nid); Setting all possible nodes online might result in quite some QE noice, because all these nodes will then be visible in the sysfs and try_offline_nodes() is essentially for the trash. I agree to prealloc the pgdat, I don't think we should actually set the nodes online. Node onlining/offlining should be done when we do have actual CPUs/memory populated. -- Thanks, David / dhildenb