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=-7.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 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 A2F72C433DB for ; Mon, 11 Jan 2021 13:30:17 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3722D221F1 for ; Mon, 11 Jan 2021 13:30:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3722D221F1 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 122728D002C; Mon, 11 Jan 2021 08:30:16 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0AA748D0020; Mon, 11 Jan 2021 08:30:16 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E8DBF8D002C; Mon, 11 Jan 2021 08:30:15 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0018.hostedemail.com [216.40.44.18]) by kanga.kvack.org (Postfix) with ESMTP id CC3E78D0020 for ; Mon, 11 Jan 2021 08:30:15 -0500 (EST) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 80C343630 for ; Mon, 11 Jan 2021 13:30:15 +0000 (UTC) X-FDA: 77693577990.17.order91_2b0fc0f2750d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin17.hostedemail.com (Postfix) with ESMTP id 654A0180D0185 for ; Mon, 11 Jan 2021 13:30:15 +0000 (UTC) X-HE-Tag: order91_2b0fc0f2750d X-Filterd-Recvd-Size: 4077 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf38.hostedemail.com (Postfix) with ESMTP for ; Mon, 11 Jan 2021 13:30:14 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 81C82221FF; Mon, 11 Jan 2021 13:30:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1610371813; bh=9u2HWgUS7+SBF2cXUUEJwwSvQMwtFkX8ve6mtxwTAK0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=i33J0sYvklsC5LMvdOiZUD222Ye0+QMPyCyLIs77djWJf8gtM9OjQJD7ZUVdeco7C oLud5b0oRQ3ocbVbqoWB0rrbZhNnejHE0an6HIOIpJaMlBybFr2Wtq94iCJqXaEjJ5 G5INIwpk5ke9G6Ww2eGWRmXHfhd5rkfD0odRytJRMcM82dPrMxSmcx0kc/0bcLPqsX XO2YRb4YZDg87YDFkl8lFlVP1DnbLMggGPL0gY9Bc4bj5ncNkDPQ25Q4v0bTHL5GWg Ue7LcULTBfONfDe4SFGPKNax/ecxXFN7zbtaZ4Tg6LStZiDjWagL3ONBsc1VCthFFC wZRs9Kj8n2aqQ== Date: Mon, 11 Jan 2021 13:30:08 +0000 From: Will Deacon To: Linus Torvalds Cc: Linux Kernel Mailing List , Linux-MM , Linux ARM , Catalin Marinas , Jan Kara , Minchan Kim , Andrew Morton , "Kirill A . Shutemov" , Vinayak Menon , Hugh Dickins , Android Kernel Team Subject: Re: [PATCH v2 0/3] Create 'old' ptes for faultaround mappings on arm64 with hardware access flag Message-ID: <20210111133007.GA7642@willie-the-truck> References: <20210108171517.5290-1-will@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) 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: On Fri, Jan 08, 2021 at 11:34:08AM -0800, Linus Torvalds wrote: > On Fri, Jan 8, 2021 at 9:15 AM Will Deacon wrote: > > > > The big difference in this version is that I have reworked it based on > > Kirill's patch which he posted as a follow-up to the original. However, > > I can't tell where we've landed on that -- Linus seemed to like it, but > > Hugh was less enthusiastic. > > Yeah, I like it, but I have to admit that it had a disturbingly high > number of small details wrong for several versions. I hope you picked > up the final version of the code. I picked the version from here: https://lore.kernel.org/r/20201229132819.najtavneutnf7ajp@box and actually, I just noticed that willy spotted a typo in a comment, so I'll fix that locally as well as adding the above to a 'Link:' tag for reference. > At the same time, I do think that the "disturbingly high number of > issues" was primarily exactly _because_ the old code was so > incomprehensible, and I think the end result is much cleaner, so I > still like it. > > >I think that my subsequent patches are an > > awful lot cleaner after the rework > > Yeah, I think that's a side effect of "now the code really makes a lot > more sense". Your subsequent patches 2-3 certainly are much simpler > now, although I'd be inclined to add an argument to "do_set_pte()" > that has the "write" and "pretault" bits in it, instead of having to > modify the 'vmf' structure. I played with a few different ways of doing this, but I can't say I prefer them over what I ended up posting. Having a bunch of 'bool' arguments makes the callers hard to read and brings into question what exactly vmf->flags is for. I also tried adding a separate 'address' parameter so that vmf->address is always the real faulting address, but 'address' is the thing to use for the pte (i.e. prefault is when 'address != vmf->address'). That wasn't too bad, but it made the normal finish_fault() case look weird. So I think I'll leave it as-is and see if anybody wants to change it later on. Will