Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp3008652rdh; Wed, 27 Sep 2023 22:42:19 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEXsNee5xwANpSSd96NGA02AhBI/wuvZ4jXSUNq0whe/tzDkVeFzo3VhXQ3q0lSj6g8/Hhe X-Received: by 2002:a17:902:dacc:b0:1c3:6d97:e89e with SMTP id q12-20020a170902dacc00b001c36d97e89emr304604plx.58.1695879739638; Wed, 27 Sep 2023 22:42:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695879739; cv=none; d=google.com; s=arc-20160816; b=jycS3QxpkdyH8ESZmLjRPGBu9z0KjVKwXyDKojtaodvw1xVaeNC9hB47G/E4leGee1 Yflg2CRYYS0PhrY7zuXqTZSEYijgUrEy64bV9451C28JvpCvXUJoKZ5WldLW2nnTPE9o 8fRO/SIeKQMFdklJgSwQjP2Rq86Kf69634shx4vPUo0/8NGz7c9URhd+wZgrgq3BlhAQ 1mHXLZPhgoYtGySmtYBtw0Gq8Fx93UP68o11DbzcPE47SiGOqFIZ5fHMV2lNrcCyNg2M BR5dhSGD7cDM6kzH4Y8TCDXvBt2rhSOar8QJcAnTID2/aSfWy8o1x/JrTzjhDOFhcgMx PnPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ZCwPpYPnIKJ23+FQx9rK0cVVUoPdRh3hzIoGlVDACG8=; fh=Xf8gFuogo5caLcYTTFWfeKWPH9DyN/+NkIe0MZ1iW9g=; b=dpUMcq2gonvnfF+m3JWwV1gDRpHkG1JuBSJrurd6MVNGBgYyIgnrQxekV7c2G7m9TS TAJqtTnmnG4SwDFAfZ0f7N3qyGSW1VSdwo1hL4nBohoG2LX7Efpt37Gq5C5kC/tSdL15 XLtaDmRe9UaM8i/QmbxZwJPSKGMfPHVqNKqfQ2IsJHFT8r8+hlJ6f4V1wFZ3CWZ1aT6F EPxCw3ITczVyv5lZQ+rlKgn3PpB6NuxKPuq+MuYk6DM22Mfb0zG03FO1TxjI3Kb3w1MF beQQx7KPXREhCPhsbhBi1Z1pDeKxTQOKsiP2+Kx4xkSqm9BjJWKezKQb1+iSOu3/gXkp pwqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PI99Mn6I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id cp1-20020a170902e78100b001bbac6722e6si16875470plb.371.2023.09.27.22.42.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Sep 2023 22:42:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PI99Mn6I; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id C7A57802DCF4; Wed, 27 Sep 2023 22:32:02 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230047AbjI1Fbl (ORCPT + 99 others); Thu, 28 Sep 2023 01:31:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230196AbjI1Fbg (ORCPT ); Thu, 28 Sep 2023 01:31:36 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56E5298 for ; Wed, 27 Sep 2023 22:31:34 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 50A53C433CA; Thu, 28 Sep 2023 05:31:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695879093; bh=jLJr0+v2Tu+NU/8srovtu2AdASkhpyBHDz0WXnuiKO4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=PI99Mn6IhUjmgddAYTialnPteqviOBMI3VHWk6CQf8yJCFtSWPBasoWP1N0nEvjnw cx30LVN/rSqc7zRaWyXk5MuKoYJyV/CYcKtDtvUGHOBIeMqBCI6Kh1r56Jb1LQBO9g SDeD0Vwrva8hQAMttkML9Ws26NKg7e6aNb2DyQyKtj0H6V/skjHT4ReaY8jWwX3bfu SpPsVVcg9GSm8wPV96sIFVHnKuu6xAIR07Cv2vebKAKdERiAraD4vFXTgYAtMdZiJZ n60mQV3VRBHQXxLvWmGJaaJiekB0+YaQrZwNobnjZTlnWhWqcvN3mYRL2hwpxgXoqD g1YETPY4DwdTA== Date: Thu, 28 Sep 2023 08:30:39 +0300 From: Mike Rapoport To: Yajun Deng Cc: akpm@linux-foundation.org, mike.kravetz@oracle.com, muchun.song@linux.dev, willy@infradead.org, david@redhat.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 1/2] mm: pass page count and reserved to __init_single_page Message-ID: <20230928053039.GR3303@kernel.org> References: <20230926023341.991124-1-yajun.deng@linux.dev> <20230926023341.991124-2-yajun.deng@linux.dev> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230926023341.991124-2-yajun.deng@linux.dev> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Wed, 27 Sep 2023 22:32:02 -0700 (PDT) On Tue, Sep 26, 2023 at 10:33:40AM +0800, Yajun Deng wrote: > When we init a single page, we need to mark this page reserved if it > does. And some pages may not need to set page count, such as compound > pages. > > Introduce enum init_page_flags, the caller init page count and mark page > reserved by passing INIT_PAGE_COUNT and INIT_PAGE_RESERVED. > > Signed-off-by: Yajun Deng > --- > v3: Introduce enum init_page_flags. > v2: Introduce INIT_PAGE_COUNT and INIT_PAGE_RESERVED. > v1: https://lore.kernel.org/all/20230922070923.355656-1-yajun.deng@linux.dev/ > --- > mm/hugetlb.c | 2 +- > mm/internal.h | 8 +++++++- > mm/mm_init.c | 31 +++++++++++++++++-------------- > 3 files changed, 25 insertions(+), 16 deletions(-) > > diff --git a/mm/mm_init.c b/mm/mm_init.c > index 06a72c223bce..07fe7e489769 100644 > --- a/mm/mm_init.c > +++ b/mm/mm_init.c > @@ -1041,7 +1043,7 @@ static void __ref memmap_init_compound(struct page *head, > for (pfn = head_pfn + 1; pfn < end_pfn; pfn++) { > struct page *page = pfn_to_page(pfn); > > - __init_zone_device_page(page, pfn, zone_idx, nid, pgmap); > + __init_zone_device_page(page, pfn, zone_idx, nid, pgmap, 0); I think the first patch should not contain any functional changes, but only add the flags parameter to __init_single_page(). > prep_compound_tail(head, pfn - head_pfn); > set_page_count(page, 0); > -- Sincerely yours, Mike.