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 X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2E868C433E6 for ; Thu, 18 Feb 2021 17:41:08 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AD48164EC2 for ; Thu, 18 Feb 2021 17:41:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AD48164EC2 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nvidia.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 1E0A96B0006; Thu, 18 Feb 2021 12:41:07 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 190826B006C; Thu, 18 Feb 2021 12:41:07 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0A6D66B006E; Thu, 18 Feb 2021 12:41:07 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0185.hostedemail.com [216.40.44.185]) by kanga.kvack.org (Postfix) with ESMTP id E82BF6B0006 for ; Thu, 18 Feb 2021 12:41:06 -0500 (EST) Received: from smtpin03.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id AD22B1DEC for ; Thu, 18 Feb 2021 17:41:06 +0000 (UTC) X-FDA: 77832104532.03.gate46_38143a227657 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin03.hostedemail.com (Postfix) with ESMTP id 9233F28A4ED for ; Thu, 18 Feb 2021 17:41:06 +0000 (UTC) X-HE-Tag: gate46_38143a227657 X-Filterd-Recvd-Size: 6168 Received: from hqnvemgate25.nvidia.com (hqnvemgate25.nvidia.com [216.228.121.64]) by imf49.hostedemail.com (Postfix) with ESMTP for ; Thu, 18 Feb 2021 17:41:05 +0000 (UTC) Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate25.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Thu, 18 Feb 2021 09:41:04 -0800 Received: from [10.2.58.214] (172.20.145.6) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 18 Feb 2021 17:40:59 +0000 From: Zi Yan To: Jason Gunthorpe CC: Matthew Wilcox , Andrew Morton , Mike Kravetz , , , Davidlohr Bueso , "Kirill A . Shutemov" , Andrea Arcangeli , Oscar Salvador , Joao Martins , Subject: Re: [PATCH 1/2] hugetlb: fix update_and_free_page contig page struct assumption Date: Thu, 18 Feb 2021 12:40:58 -0500 X-Mailer: MailMate (1.14r5757) Message-ID: In-Reply-To: <20210218173200.GA2643399@ziepe.ca> References: <20210217184926.33567-1-mike.kravetz@oracle.com> <20210217110252.185c7f5cd5a87c3f7b0c0144@linux-foundation.org> <20210218144554.GS2858050@casper.infradead.org> <20210218172500.GA4718@ziepe.ca> <19612088-4856-4BE9-A731-BB903511F352@nvidia.com> <20210218173200.GA2643399@ziepe.ca> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=_MailMate_9672FF2B-52FE-4CA2-9097-E065627201D6_="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Originating-IP: [172.20.145.6] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To HQMAIL107.nvidia.com (172.20.187.13) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1613670064; bh=qWYZkAwpt/HcHkeBf1Pde8huVd2T36KQs23OXt2Oa4M=; h=From:To:CC:Subject:Date:X-Mailer:Message-ID:In-Reply-To: References:MIME-Version:Content-Type:X-Originating-IP: X-ClientProxiedBy; b=DhirbqqmCN2UHWdzHBUuKlsFuS8lNlq3de9yK6IaF9E2Gcu5ARhMfV+fCmUj/7K4Q YQs1kF/W0dbgbuEbDodiUPFq/DQHuLwHZyZuEVZqutMuMdTSWJb0lt0aEQWK+eE+Gr apKImC52aPxSLLWjYEWC5WkKxxQGLLZHH9xOjVMhbD/I9AVPM6CwJa5zhMpg51RzZ1 SyrG/ZmZRjR3V68RAOla7Juk9kz40K79MwFsNDlvdd90oitKcKQ7cJ5eCvM0/2pq6q GNuuIPmBFexExW1ojJoEM7PxMGpiMw4yLRUYyWZwPSxuhK2ZNS7Or33z6V6WDw75o1 DRu8ak1vpr/+g== 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: --=_MailMate_9672FF2B-52FE-4CA2-9097-E065627201D6_= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On 18 Feb 2021, at 12:32, Jason Gunthorpe wrote: > On Thu, Feb 18, 2021 at 12:27:58PM -0500, Zi Yan wrote: >> On 18 Feb 2021, at 12:25, Jason Gunthorpe wrote: >> >>> On Thu, Feb 18, 2021 at 02:45:54PM +0000, Matthew Wilcox wrote: >>>> On Wed, Feb 17, 2021 at 11:02:52AM -0800, Andrew Morton wrote: >>>>> On Wed, 17 Feb 2021 10:49:25 -0800 Mike Kravetz wrote: >>>>>> page structs are not guaranteed to be contiguous for gigantic page= s. The >>>>> >>>>> June 2014. That's a long lurk time for a bug. I wonder if some la= ter >>>>> commit revealed it. >>>> >>>> I would suggest that gigantic pages have not seen much use. Certain= ly >>>> performance with Intel CPUs on benchmarks that I've been involved wi= th >>>> showed lower performance with 1GB pages than with 2MB pages until qu= ite >>>> recently. >>> >>> I suggested in another thread that maybe it is time to consider >>> dropping this "feature" >> >> You mean dropping gigantic page support in hugetlb? > > No, I mean dropping support for arches that want to do: > > tail_page !=3D head_page + tail_page_nr > > because they can't allocate the required page array either virtually > or physically contiguously. > > It seems like quite a burden on the core mm for a very niche, and > maybe even non-existant, case. > > It was originally done for PPC, can these PPC systems use VMEMMAP now? > >>> The cost to fix GUP to be compatible with this will hurt normal >>> GUP performance - and again, that nobody has hit this bug in GUP >>> further suggests the feature isn't used.. >> >> A easy fix might be to make gigantic hugetlb page depends on >> CONFIG_SPARSEMEM_VMEMMAP, which guarantee all struct pages are contigu= ous. > > Yes, exactly. I actually have a question on CONFIG_SPARSEMEM_VMEMMAP. Can we assume PFN_A - PFN_B =3D=3D struct_page_A - struct_page_B, meaning all struct pa= ges are ordered based on physical addresses? I just wonder for two PFN ranges= , e.g., [0 - 128MB], [128MB - 256MB], if it is possible to first online [128MB - 256MB] then [0 - 128MB] and the struct pages of [128MB - 256MB] are in front of [0 - 128MB] in the vmemmap due to online ordering. =E2=80=94 Best Regards, Yan Zi --=_MailMate_9672FF2B-52FE-4CA2-9097-E065627201D6_= Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJDBAEBCgAtFiEEh7yFAW3gwjwQ4C9anbJR82th+ooFAmAupqoPHHppeUBudmlk aWEuY29tAAoJEJ2yUfNrYfqKfTEP/24G+3DlCRGKIQ6Z6pFwpTnIeGiEsfOlpmoh Z839+9t3dqyyxmPurnIA9p6bRqA0rSi50GM/S89WZCTu3bE9foYuFIfH4mO9hEih k5oTbYN1ZeqgGb6AcnW66oNQMWG/XaCnwXbUMZHZQFJpv6S/6faKQr3BhqXPxRvp lTfU4FTXmuRkbLudu1wShDs1Vfyp2gJYipQ+pRFQ7bB+NDlcltgbc4OYPxCE6Z6L 9BdDccewpeT1vxTethwaRviv+ODykQiXmeOw96QZC4Whetq4R1mBm38bC7qDiluQ Rwrm95x/JR1zVfL28MoisrSW/CVOMMv/hUAp1sW8doOc/gVvB/XM2In0t+aqCYCd MVxsu3IRiRAJhWC0JVHo8eUnrBQj0MMITKUafbwkp5/aZvW3HRTuRlS1Z2hfVeab ndzuKHcWo6ywHAHnHR+kns/Chmolu3SMvTQURWHWp7c9cO6l8vN6MZAM9wF2qbro derwXpdthcmAAdyQF/ZNk9fSaRn7ZrIkqIzb9Dz0cu7bUWDLuGQN+NntpAyKr7iD mrAraPk5xLxpOVUaFtynwHnLziK+0Kmy54SDooRacDT7TYU+7s6t/YDoUFa/qUD0 QDeqSKnuaeFHc+fBq7cjDgyNOsOF5HPL8RvS8rX4oG5PaSpLgYZKZNDXMtvRURPF AyuyJfXl =HzBR -----END PGP SIGNATURE----- --=_MailMate_9672FF2B-52FE-4CA2-9097-E065627201D6_=--