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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A66FEC83F12 for ; Mon, 28 Aug 2023 07:27:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229715AbjH1H1a (ORCPT ); Mon, 28 Aug 2023 03:27:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229772AbjH1H1K (ORCPT ); Mon, 28 Aug 2023 03:27:10 -0400 Received: from out-247.mta0.migadu.com (out-247.mta0.migadu.com [91.218.175.247]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D95F1118 for ; Mon, 28 Aug 2023 00:27:06 -0700 (PDT) Content-Type: text/plain; charset=us-ascii DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1693207625; 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=R1NgD96YxNwdzL2uCYD5ii12GD63NiBnFyl1V0bsWgU=; b=kBohejIUfe4qavE/Pfj84fYIbI0aTk/Vuw6//C4RPOm1ULNWbER5c4aDJWuUFisvJolha2 B7lQgiUnF6nVy/lEyGFUlbaBqMA2QKX72N6toB1qFibrnnoEqZhsmyWvQb4UTSViTFtGQD Ap6K2ze2daK+iw11rBwUt5qeJRNRbnY= Mime-Version: 1.0 Subject: Re: [v3 3/4] memblock: introduce MEMBLOCK_RSRV_NOINIT_VMEMMAP flag X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Muchun Song In-Reply-To: <20230825111836.1715308-4-usama.arif@bytedance.com> Date: Mon, 28 Aug 2023 15:26:17 +0800 Cc: Linux-MM , Mike Kravetz , Mike Rapoport , linux-kernel@vger.kernel.org, Muchun Song , fam.zheng@bytedance.com, liangma@liangbit.com, punit.agrawal@bytedance.com Content-Transfer-Encoding: quoted-printable Message-Id: <357EEE41-1898-4430-BCC7-73F591CE8749@linux.dev> References: <20230825111836.1715308-1-usama.arif@bytedance.com> <20230825111836.1715308-4-usama.arif@bytedance.com> To: Usama Arif X-Migadu-Flow: FLOW_OUT Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Aug 25, 2023, at 19:18, Usama Arif = wrote: >=20 > For reserved memory regions marked with this flag, > reserve_bootmem_region is not called during = memmap_init_reserved_pages. > This can be used to avoid struct page initialization for > regions which won't need them, for e.g. hugepages with > HVO enabled. >=20 > Signed-off-by: Usama Arif Reviewed-by: Muchun Song One nit below. > --- > include/linux/memblock.h | 10 ++++++++++ > mm/memblock.c | 32 +++++++++++++++++++++++++++----- > 2 files changed, 37 insertions(+), 5 deletions(-) >=20 > diff --git a/include/linux/memblock.h b/include/linux/memblock.h > index f71ff9f0ec81..6d681d053880 100644 > --- a/include/linux/memblock.h > +++ b/include/linux/memblock.h > @@ -40,6 +40,8 @@ extern unsigned long long max_possible_pfn; > * via a driver, and never indicated in the firmware-provided memory = map as > * system RAM. This corresponds to IORESOURCE_SYSRAM_DRIVER_MANAGED in = the > * kernel resource tree. > + * @MEMBLOCK_RSRV_NOINIT_VMEMMAP: memory region for which struct = pages are > + * not initialized (only for reserved regions). We have a more detailed explanation here. > */ > enum memblock_flags { > MEMBLOCK_NONE =3D 0x0, /* No special request */ > @@ -47,6 +49,8 @@ enum memblock_flags { > MEMBLOCK_MIRROR =3D 0x2, /* mirrored region */ > MEMBLOCK_NOMAP =3D 0x4, /* don't add to kernel direct mapping */ > MEMBLOCK_DRIVER_MANAGED =3D 0x8, /* always detected via a driver = */ > + /* don't initialize struct pages associated with this reserver = memory block */ Those comments right after the macros here seem like a brief = explanation. To keep the consistent with others, maybe "don't initialize struct = pages" is enough? At least, a detailed one is redundant and repetitive compared with the above one. > + MEMBLOCK_RSRV_NOINIT_VMEMMAP =3D 0x10, > };