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 61475C433EF for ; Tue, 7 Dec 2021 18:03:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D4B286B0072; Tue, 7 Dec 2021 13:03:43 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CD32C6B0073; Tue, 7 Dec 2021 13:03:43 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AFF826B0074; Tue, 7 Dec 2021 13:03:43 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0133.hostedemail.com [216.40.44.133]) by kanga.kvack.org (Postfix) with ESMTP id 9E4B96B0072 for ; Tue, 7 Dec 2021 13:03:43 -0500 (EST) Received: from smtpin08.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 663591807CACF for ; Tue, 7 Dec 2021 18:03:33 +0000 (UTC) X-FDA: 78891770706.08.5C32A54 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by imf22.hostedemail.com (Postfix) with ESMTP id BD4511903 for ; Tue, 7 Dec 2021 18:03:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1638900212; 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=Eqw4DoNoRPNIxom496Pc+xv9s4RxxJr7evCd8ALX3L4=; b=L79s9uhaO9euBZDm1pMMYh0V9KQ3qdVgxHa8JrqnW03YILB/wPQ19jdrFfobdIdWBA/sL1 sofru0v+x9VFdPjN9uE59ol3Fr9iDMEnvvX0NCAAtdpcVf/FdEd2NhgnG+3k/7V2OrzWnD 9jhN+R91Y+7GM008GovCt9ZEgy9MJNw= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-217-njO5januMWSCe-6raEpIiw-1; Tue, 07 Dec 2021 13:03:30 -0500 X-MC-Unique: njO5januMWSCe-6raEpIiw-1 Received: by mail-wm1-f72.google.com with SMTP id l6-20020a05600c4f0600b0033321934a39so21700wmq.9 for ; Tue, 07 Dec 2021 10:03:30 -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=Eqw4DoNoRPNIxom496Pc+xv9s4RxxJr7evCd8ALX3L4=; b=TTTQ+V2IX/LTVky8ckwWDeaFNohGLMuHFpwTSfBXcNj2xUhgcLG8HdZN4JEKtli6GB UaKWeHFsMppDY7qWJgqxLTmqXP5FDsGFdjfZpyy0UvLIp/C3te7MItVonsIBnWpknoCO E3tH2xXMOmnHFTh1wNR2r5Kl6ILSH8FADOs+0GHC4xyiOuQDk+Fho5Y9FRwZ6ei5r5Bb iIS9HDs80Ecx7XlmNAqgL5MLcX83RGSc1hLm5tlanuYKTuWey9L/wESBNzyJbO3UpaMn h3CQJG/GxBNvDKvtMQhzM8h8rNaPLbgt0Q7R3QqkjYHo14HzxSziibjs+dHd4kooOT/P QGEw== X-Gm-Message-State: AOAM532osL+H3IfpPE9XgmTxm9/43iaBWM9VE5fGWLbdsEjt9GOVd20t OkUlmN3+f+J5tn6g98jCXHmQVREiKOQ+R+QfvaQM1A1xGGlCcrRW0FdvSOkgGxbHkIt6MakQoJU XXWIxs89KqFs= X-Received: by 2002:a5d:6d86:: with SMTP id l6mr52287895wrs.304.1638900209771; Tue, 07 Dec 2021 10:03:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJwi72F1ctCVXtt4jzHgXreODAaisUhpw5bIQfwl5selrgG8TcO2EZzvZhkkxevEpYYqSoZBCA== X-Received: by 2002:a5d:6d86:: with SMTP id l6mr52287864wrs.304.1638900209553; Tue, 07 Dec 2021 10:03:29 -0800 (PST) Received: from [192.168.3.132] (p4ff23e57.dip0.t-ipconnect.de. [79.242.62.87]) by smtp.gmail.com with ESMTPSA id c10sm397552wrb.81.2021.12.07.10.03.28 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Dec 2021 10:03:29 -0800 (PST) Message-ID: Date: Tue, 7 Dec 2021 19:03:28 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 To: Alexey Makhalov Cc: Michal Hocko , 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: <1043a1a4-b7f2-8730-d192-7cab9f15ee24@redhat.com> <77e785e6-cf34-0cff-26a5-852d3786a9b8@redhat.com> <2E174230-04F3-4798-86D5-1257859FFAD8@vmware.com> <21539fc8-15a8-1c8c-4a4f-8b85734d2a0e@redhat.com> <78E39A43-D094-4706-B4BD-18C0B18EB2C3@vmware.com> From: David Hildenbrand Organization: Red Hat Subject: Re: [PATCH v3] mm: fix panic in __alloc_pages In-Reply-To: <78E39A43-D094-4706-B4BD-18C0B18EB2C3@vmware.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: BD4511903 X-Stat-Signature: e6hnzx9jouk9f91dw5jrhnhobxs3fiyi Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=L79s9uha; spf=none (imf22.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-HE-Tag: 1638900212-112283 Content-Transfer-Encoding: quoted-printable 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 18:17, Alexey Makhalov wrote: >=20 >=20 >> On Dec 7, 2021, at 9:13 AM, David Hildenbrand wrote= : >> >> On 07.12.21 18:02, Alexey Makhalov wrote: >>> >>> >>>> On Dec 7, 2021, at 8:36 AM, Michal Hocko wrote: >>>> >>>> On Tue 07-12-21 17:27:29, Michal Hocko wrote: >>>> [...] >>>>> So your proposal is to drop set_node_online from the patch and add = it as >>>>> a separate one which handles >>>>> - sysfs part (i.e. do not register a node which doesn't span a >>>>> physical address space) >>>>> - hotplug side of (drop the pgd allocation, register node lazily >>>>> when a first memblocks are registered) >>>> >>>> In other words, the first stage >>>> diff --git a/mm/page_alloc.c b/mm/page_alloc.c >>>> index c5952749ad40..f9024ba09c53 100644 >>>> --- a/mm/page_alloc.c >>>> +++ b/mm/page_alloc.c >>>> @@ -6382,7 +6382,11 @@ static void __build_all_zonelists(void *data) >>>> if (self && !node_online(self->node_id)) { >>>> build_zonelists(self); >>>> } else { >>>> - for_each_online_node(nid) { >>>> + /* >>>> + * All possible nodes have pgdat preallocated >>>> + * free_area_init >>>> + */ >>>> + for_each_node(nid) { >>>> pg_data_t *pgdat =3D NODE_DATA(nid); >>>> >>>> build_zonelists(pgdat); >>> >>> Will it blow up memory usage for the nodes which might never be onlin= ed? >>> I prefer the idea of init on demand. >>> >>> Even now there is an existing problem. >>> In my experiments, I observed _huge_ memory consumption increase by i= ncreasing number >>> of possible numa nodes. I=E2=80=99m going to report it in separate ma= il thread. >> >> I already raised that PPC might be problematic in that regard. Which >> architecture / setup do you have in mind that can have a lot of possib= le >> nodes? >> > It is x86_64 VMware VM, not the regular one, but specially configured (= 1 vCPU per node, > with hot-plug support, 128 possible nodes) =20 I thought the pgdat would be smaller but I just gave it a test: On my system, pgdata_t is 173824 bytes. So 128 nodes would correspond to 21 MiB, which is indeed a lot. I assume it's due to "struct zonelist", which has MAX_ZONES_PER_ZONELIST =3D=3D (MAX_NUMNODES * MAX_NR_ZONES) zon= e references ... --=20 Thanks, David / dhildenb