Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp32950pxk; Wed, 2 Sep 2020 13:34:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxl63XTl248ZHGhwjfyu6kU4O0fTCddGNun0NUThbkpgF+w64Mfclb0fxZC3C/bRmGG20Cr X-Received: by 2002:a17:906:2998:: with SMTP id x24mr1746167eje.131.1599078845319; Wed, 02 Sep 2020 13:34:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599078845; cv=none; d=google.com; s=arc-20160816; b=cV4fsxXkMA0QbLKCV5NEpstbo685ezLfs89FDLVtIQ7BHd822lMO242kH48u4ByiC1 bgQVicMjmuhVBzwlqBsK0kc/GuixfoTroilO1KHSR6troypludhbHVt2ohwXwwkKrWY7 13tmFFOJI5a3sXmzzqB2xi+Y5silNbT6bhEw7FoxXTnYQVSD2qIRy+hf6AfJEfi8e6uW JtZfootNdXDfY3PXQhbUJhSGwS9Z05NINtiCDebYC0YOry/auQZ8JAsitvkoB6RXDWGo ETpkHbYe8RfjX1QtbI2Vy0uYQtId3pk9oez4V2lBfcD4dWmO8q4W4BqrIXSaT2SpE0Rn X21w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from; bh=GpHPYB1gS6qMjgfjjB2zkmvO3GismXrLdGUFN1+sYQ4=; b=s2kj2JjH34/KY2Ru12DruLvAp8FAmqMCHw3ShrELr55Z3XER7fR+60K6x4GJgBaoH2 0hUTLHhWX1XGv57VumFBmD//dp6mvxPiYdunF4iOBBcLmLaaSlVWgGB00NHrJ50qCnQp 2UPWnoJIzade2wvkau/b4rWlF+sa5ZCA7uYWRn6aIYqF1tZT13cSUz5mHuDUlV3Sa78f vIV4UcxA3AJM8ojyOkTX6TYboAtfWXG5qv54RZxW3I6Lj5llZg0FIPh/5fKa7pJY1Ads Rc7bXC33ap9Ld7WX9LIE1KT97+ZtX6zpa32ZtVaujhmpITaS0Iltdn+B3lSOFtVqfYEE oEGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=UlBR3FG5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i18si237938edg.115.2020.09.02.13.33.42; Wed, 02 Sep 2020 13:34:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=UlBR3FG5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726733AbgIBU3w (ORCPT + 99 others); Wed, 2 Sep 2020 16:29:52 -0400 Received: from hqnvemgate26.nvidia.com ([216.228.121.65]:2822 "EHLO hqnvemgate26.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726226AbgIBU3v (ORCPT ); Wed, 2 Sep 2020 16:29:51 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate26.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Wed, 02 Sep 2020 13:29:36 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Wed, 02 Sep 2020 13:29:50 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Wed, 02 Sep 2020 13:29:50 -0700 Received: from [10.2.161.253] (172.20.13.39) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Wed, 2 Sep 2020 20:29:47 +0000 From: Zi Yan To: Jason Gunthorpe CC: , Roman Gushchin , Rik van Riel , "Kirill A . Shutemov" , Matthew Wilcox , Shakeel Butt , Yang Shi , David Nellans , Subject: Re: [RFC PATCH 00/16] 1GB THP support on x86_64 Date: Wed, 2 Sep 2020 16:29:46 -0400 X-Mailer: MailMate (1.13.1r5705) Message-ID: In-Reply-To: <20200902195739.GI24045@ziepe.ca> References: <20200902180628.4052244-1-zi.yan@sent.com> <20200902184053.GF24045@ziepe.ca> <20200902184852.GH24045@ziepe.ca> <20200902195739.GI24045@ziepe.ca> MIME-Version: 1.0 X-Originating-IP: [172.20.13.39] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To HQMAIL107.nvidia.com (172.20.187.13) Content-Type: multipart/signed; boundary="=_MailMate_0F9721AF-59A2-4F1F-84D6-26E9CBFFF0C7_="; micalg=pgp-sha512; protocol="application/pgp-signature" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1599078576; bh=GpHPYB1gS6qMjgfjjB2zkmvO3GismXrLdGUFN1+sYQ4=; h=X-PGP-Universal:From:To:CC:Subject:Date:X-Mailer:Message-ID: In-Reply-To:References:MIME-Version:X-Originating-IP: X-ClientProxiedBy:Content-Type; b=UlBR3FG5VVB+m7Kh0n22MMWoBCvylenwxI8qKQy4FZjdzSPPpj6tpT5wB5oOE60SH JWD27ogvztYveglSv8ssSUUHgBdNR6hWUtmdzD0nQTGughEN0rVuCavuZ4nFfWQW5/ Ayu7+BS58BWDUEuCylfWvXHhvjaJ3Fut0MO8xfRY7AuaWomQxXKfMKr22Qp8079dOk y4D/P0ncpld3kwbH2oMzGjiyrzW08UnhlgBbrbiyKP7Mt6yy8+7k6OGVlA31BunVSU ITEGUZ2CGoSItN2ongkRE+o4UWziBIC0s2QuAy7NtaemYzRhP6TZRzyDQ0mxY2LC0Z DWEfiQ1MbX7JA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=_MailMate_0F9721AF-59A2-4F1F-84D6-26E9CBFFF0C7_= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On 2 Sep 2020, at 15:57, Jason Gunthorpe wrote: > On Wed, Sep 02, 2020 at 03:05:39PM -0400, Zi Yan wrote: >> On 2 Sep 2020, at 14:48, Jason Gunthorpe wrote: >> >>> On Wed, Sep 02, 2020 at 02:45:37PM -0400, Zi Yan wrote: >>> >>>>> Surprised this doesn't touch mm/pagewalk.c ? >>>> >>>> 1GB PUD page support is present for DAX purpose, so the code is ther= e >>>> in mm/pagewalk.c already. I only needed to supply ops->pud_entry whe= n using >>>> the functions in mm/pagewalk.c. :) >>> >>> Yes, but doesn't this change what is possible under the mmap_sem >>> without the page table locks? >>> >>> ie I would expect some thing like pmd_trans_unstable() to be required= >>> as well for lockless walkers. (and I don't think the pmd code is 100%= >>> right either) >>> >> >> Right. I missed that. Thanks for pointing it out. >> The code like this, right? > > Technically all those *pud's are racy too, the design here with the > _unstable function call always seemed weird. I strongly suspect it > should mirror how get_user_pages_fast works for lockless walking You mean READ_ONCE on page table entry pointer first, then use the value for the rest of the loop? I am not quite familiar with this racy check part of the code and happy to hear more about it. =E2=80=94 Best Regards, Yan Zi --=_MailMate_0F9721AF-59A2-4F1F-84D6-26E9CBFFF0C7_= Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJDBAEBCgAtFiEEh7yFAW3gwjwQ4C9anbJR82th+ooFAl9QALoPHHppeUBudmlk aWEuY29tAAoJEJ2yUfNrYfqKMoUP/0YDqdUWR4QJQvyNiGEdl6Cf9Rs2/agY2YwP ZnErHG6+CxMWciGGm4F8UY0tlEwdSVpMGsTK7vDt267uqOpdplXIqM6+MXoTS1Bc PnAyv6Pkmb4MDyOl93qw+b3vkFUc8rYemRfygoTiAjHq/HXMBsW6of6JuGaS5F36 LyiC7wxlnZ25ZO1oquTStn56LSLmhoka/Pz4HCF+oNm/1oSZaXWv6UQFgwd5RfJt FqwkxorMiI34z08M85oJQL5BX8f0FufmTjYgSkKy2oJs3Hd8lERjv5RCKptpMXaY c46GsjF31xVaAU160N2wvrBlzGiqXZOi68J2M7inI02AHkO7J+SC8GV2ssR+kKrB aXrfX1FIwmGJLRnubYyJWtn0gOAXV9f1rQRsmjb1r+OT29CR8JCTjxpuOugqeei3 1jl4j4sppck37tjXdm8XE9kfHBAEULxYXxbupkZXqc8Aqu8kRbQDdYrD8nammB6h Msk7SRsV7UbOmwIHPYVvOS5U83RYxbVaLaYseLZWiWvGoikWCpU4JYBCQ0FW4xNL 8Y1rovrBYB7vQUjGkbaGXKuxOF5VUeLVHIq8S2uVEqn48NW1R/GEznZgabtf1wjM 6I+PI3GQ7IunfjDj80T/a2FPQQ1BFTjYOQaCP/F8vylb1yjnKgmJTRRCVbqs8Bs7 Yf09muCw =A7I9 -----END PGP SIGNATURE----- --=_MailMate_0F9721AF-59A2-4F1F-84D6-26E9CBFFF0C7_=--