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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1DB5C433EF for ; Wed, 8 Dec 2021 08:19:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244723AbhLHIWv (ORCPT ); Wed, 8 Dec 2021 03:22:51 -0500 Received: from mail-dm6nam12on2078.outbound.protection.outlook.com ([40.107.243.78]:59680 "EHLO NAM12-DM6-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231496AbhLHIWt (ORCPT ); Wed, 8 Dec 2021 03:22:49 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ESeXqua+lj7i4aBeuqQwjUfm50esAX3E0nYk8rDtBGCCPQaT4/GdfSUfdMeaB8JYJvMSBYlw8LveWbCUIac/qfx/nLj/hQjiTvNoiYA5arlJ9WIJLgVCgolTW7+nKi362YsP1s1o/4UnQwf7pyqKysaCe6KujCdshSS35Tgcy4dW1FG+zNX+ElE9ZBqOgLmjnZJLKWfuc8q3hYsogcaXB3YAHFttPeO86YTFgBTxIJnvPJ6Nfk5H6eh09iVaglh3NN7Xk0/2YB+gdS3ogJfVUsn4CN6wPnQlAh54MzQuOEEQ/nybJTSohPi15dptc8N1DIZP4shBiNXoD/EkOa1AoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=09YRmKc+PmkVSTiQ8XWGDxAa4n3zH8PXDZbSHzgGcZM=; b=GCPiZ33MOMZvO3O9NBzRaguK0zmsEMymCwFFuJd4lP0w1g7BRAZt4HhC5kMR20Itvjmj3Sl02/2kdcdKIzDD95GYT8JW4/Rgfiys2lAsydFPGxER4L5qqYMhiLxcyGXtXicOV9HB91G0d66je/8ZeHJ8VlZnNNawg6QSZdv3VfzGKqfMWi53fVoh3qCim5NpD4lT+ypZg1joKzOh3MrfYTXXRpVV5qzGkOZXBtfe02u3hLBSEvJqtWQYNUTkcQRmyRTpD0cbZaxZwua3e3bGpAHwXyQaYGWCNsuywI7sXpbeFmhvuPPKbVX1Ls6HOgYd3uXGKrNspOKtvSqQPl7dfQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=vmware.com; dmarc=pass action=none header.from=vmware.com; dkim=pass header.d=vmware.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vmware.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=09YRmKc+PmkVSTiQ8XWGDxAa4n3zH8PXDZbSHzgGcZM=; b=lKtmBjSLdSVUcz98mybb2hO4QYwzoAwvPghFMNHBoM/ca6dBFKFXBF081neuO8b39PmdY/P7W3HckGZn30/ZncKmmk5hskn6Dahuj8Q+qVD+vpyIQ50v3C/6DJRR+WQCpjAo+vZZGvmq/3qmAUllazPTmF+m7qUbmHLW7K8+HEA= Received: from MWHPR05MB3648.namprd05.prod.outlook.com (10.174.250.151) by MWHPR05MB2832.namprd05.prod.outlook.com (10.168.244.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.11; Wed, 8 Dec 2021 08:19:16 +0000 Received: from MWHPR05MB3648.namprd05.prod.outlook.com ([fe80::6929:b34e:d8b9:70bc]) by MWHPR05MB3648.namprd05.prod.outlook.com ([fe80::6929:b34e:d8b9:70bc%3]) with mapi id 15.20.4778.012; Wed, 8 Dec 2021 08:19:16 +0000 From: Alexey Makhalov To: Michal Hocko CC: David Hildenbrand , 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" Subject: Re: [PATCH v3] mm: fix panic in __alloc_pages Thread-Topic: [PATCH v3] mm: fix panic in __alloc_pages Thread-Index: AQHX1N5+lqzX5/9/hUCR9L+z9tfLRKv6c74AgAD9U4CAAB7tAIAADZWAgAnMHQCAAIIHgIAAufyAgAJfDQCAHgMmAIAABAWAgAASAgCAAAQ5gIAADzyAgAAdyYCAAAWLgIAAAWYAgAAGEoCAAAPOAIAABOmAgAACrYCAAAckgIAAAy2AgAAA/ACAAPfNgIAABCeA Date: Wed, 8 Dec 2021 08:19:16 +0000 Message-ID: <0E315E66-7EE2-42D8-B1B5-BD49E21AD67E@vmware.com> References: <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> In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: yes X-MS-TNEF-Correlator: x-mailer: Apple Mail (2.3654.120.0.1.13) authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=vmware.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 4fe9c416-f553-4eea-576e-08d9ba236cc7 x-ms-traffictypediagnostic: MWHPR05MB2832:EE_ x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 1u96nj4pjyQuHWXy7vDgthpUe5Dp23g5EuqodoBLAGr+fGo6H2wtFrsxpLAF1aTjU+FmBzLoTzym/0AOyJhfiSQSdhTicDYCTu9wY7tv+kt8Q/javVhwAAPUvQx90ClZiapykKTkmyiNqURJGGmSY8Eku7N2Oa0n/IdTMmtizJza2L9znGNjWH/RhKwWi2JvQbLDQsXwJmcIY9qQAHcXf1ad7gXZydoJK2/E2dF3NgswT8Ixf8U2FG17NN9Y7+uj9wIOgNrs4eKqkdrxDaXX2BTGU9K/sSXiLIV3ewVzPu2PNw+AMYDV+ywqmkRN4oezGRQKZFpLxdqMQiCmy4Fif+gpVVDBNVwWcWiCvwkXlO2Tv78U4Ylx7V6nz6vfB47+3YIZW3jHtKr0aBcpV5nImEf7aaoH4p6avOV/yFx1nYKgm3t9FFjc6JrhoScwXu1uCNRVHdMKdI2sGs6ga5CCR5EYvFMdrRHx/mmD0nP3/KnEP70ttBJj5FK+NRUX3w+9CCa5X3LLe5MFDwAwyLm4AfW26vGvF/KuOIq+bc/aaNIDe/phFtP4urcyoi8lKu9Q4YNdBQ5mS5eb7ARribLdTM6VSfZNH45FYC5nS8gt4tMvxGE7ZsTiTNe3sRbP6vBpcXIAW7iSPBpkj4uxQahg+MsUiB+RzolAKU70mwjD26wQX1RKK0YSToH4SmS5crpV3EP/AB+RVLOLXstHgQVRmzth39Bzx7AeUJY6t6DftuRB/oLbCaDbJyE4uImUuBzL x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR05MB3648.namprd05.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(4326008)(6506007)(2616005)(122000001)(6486002)(5660300002)(83380400001)(38100700002)(53546011)(186003)(86362001)(36756003)(38070700005)(26005)(6512007)(99936003)(316002)(7416002)(66476007)(66556008)(91956017)(76116006)(8936002)(8676002)(33656002)(66946007)(71200400001)(6916009)(2906002)(66446008)(64756008)(54906003)(508600001)(45980500001);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?utf-8?B?NmxaMXJMRlFNSVpXT1hDS3pwS01GbW1ZeGxNOXBhK25yS1V5VVJWa1pGM0RM?= =?utf-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ppbjJvcHlsVEQySUtBcis0ZjRBZk13SjBm?= =?utf-8?B?ZlBwUWExUXo1Q2dIOWZWNDlHZ052ckY2RGV2dHEzdFcrVG4yZHF4QUI2KzZn?= =?utf-8?B?dUNFYk94MVpZOHp3blpxanpFaHFoSmdkWkZKT2pQdDliVWZ4V3ZtaENhZEdh?= =?utf-8?B?KzlNV3l1b2ppNTU3T25OeHcyNm9DbG44c0lodTdwYmRPWERCYzY2L0h6ZklE?= =?utf-8?B?MnpNNkhCVnE4b015QVVNOFNqb3hNQkxVMGhmRDdMUmt6UEp6UWxOVGp5VnlV?= =?utf-8?B?V3YxbjlvV2xOc0c4TU1kYUIyRWV2ZzNOSmV6WGFMZGRtMmhmVCtvWWxjTk1m?= =?utf-8?Q?/6IkrnNQbFnaIQ0hAyX0IbU=3D?= Content-Type: multipart/signed; boundary="Apple-Mail=_4261D8A3-F9C0-4216-A162-95463D354A6A"; protocol="application/pgp-signature"; micalg=pgp-sha256 MIME-Version: 1.0 X-OriginatorOrg: vmware.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MWHPR05MB3648.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4fe9c416-f553-4eea-576e-08d9ba236cc7 X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Dec 2021 08:19:16.0167 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: b39138ca-3cee-4b4a-a4d6-cd83d9dd62f0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: ffjiiueKnw8CWIgEuF9qTO4uIf0YnY11jiG3cCCgN3J600bkJ1N/lIPYhSgZem6c6pijmFU9jz2jrKY50r0Nmw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR05MB2832 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --Apple-Mail=_4261D8A3-F9C0-4216-A162-95463D354A6A Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 Hi Michal, > On Dec 8, 2021, at 12:04 AM, Michal Hocko wrote: >=20 > On Tue 07-12-21 17:17:27, Alexey Makhalov wrote: >>=20 >>=20 >>> On Dec 7, 2021, at 9:13 AM, David Hildenbrand = wrote: >>>=20 >>> On 07.12.21 18:02, Alexey Makhalov wrote: >>>>=20 >>>>=20 >>>>> On Dec 7, 2021, at 8:36 AM, Michal Hocko wrote: >>>>>=20 >>>>> 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) >>>>>=20 >>>>> 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); >>>>>=20 >>>>> build_zonelists(pgdat); >>>>=20 >>>> Will it blow up memory usage for the nodes which might never be = onlined? >>>> I prefer the idea of init on demand. >>>>=20 >>>> Even now there is an existing problem. >>>> In my experiments, I observed _huge_ memory consumption increase by = increasing number >>>> of possible numa nodes. I=E2=80=99m going to report it in separate = mail thread. >>>=20 >>> 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 = possible >>> nodes? >>>=20 >> 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 > This is slightly tangent but could you elaborate more on this setup = and > reasoning behind it. I was already curious when you mentioned this > previously. Why would you want to have so many nodes and having 1:1 = with > CPUs. What is the resulting NUMA topology? This setup with 128 nodes was used purely for development purposes. That = is when the issue with hot adding numa nodes was found. Original issue presents even with = feasible number of nodes. Thanks, =E2=80=94Alexey --Apple-Mail=_4261D8A3-F9C0-4216-A162-95463D354A6A Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEQe6bu7hIFElmsM7CGW4w8WwwaSUFAmGwaoIACgkQGW4w8Www aSV++BAAgR/2yrKilIDIOOMOxbb4nW0SyWWhUJb6WBZGp9O5RIqC6wsi4bJdd0z4 9WIhGGWVWFFRJZtmiGDldRQnYMwfdFB0uQPRKWEqnxcozoHim/1HhS5ICWGO9OSm /EnEoE/xo7wwEQuaJGf1Ju9bM94eNmEK3jOsz/w98isodwi0AatJnbnyYhqL/3mK pyTNtJm6DjITNBkhYQGm4P67aO/uulJd3R/Z/ORNvVchKEAoPrMT1F2ZnvyVtjcA IW0Kzg+PycxmNf/o7QSl3uDSmKi2lu73LvG5XftUJ3OETEpaLyJNs8dWbN4n9KjH 8+WrUxuW7uD6O3AeARp5bDQ94LwL0OJs4lPXmvS6glRikad0WpiuYK145q4qvBC1 GFPVukU2KtH3V3CfqaZ3U/pegP6U+7POqSsgo1bN9k32N4x14elVA8ZGj8U8cPk3 N37tOKJw6Cbp3k3XTbbuum+U8CiBPQ1wzsG0+J+jc5LO0twRgV5/HD7omizTNTqJ F1cdHtjkIKXDTKEDpDPl/50nve/IG40rmTCfR2KFK6BI1vko+4MJ+qDzBZlMQJb+ zBHajg+u5tToRbKjldVeJzR6ewR9jBqTPOUtF1ZB8BQFetlLReuBsB3mkTMhUqqZ BKBso0XijZVCkITVbKdtLltIzY6vHx3GIP3RceKKI65Kwwr5a8I= =1X5J -----END PGP SIGNATURE----- --Apple-Mail=_4261D8A3-F9C0-4216-A162-95463D354A6A--