Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp1327389pxk; Thu, 10 Sep 2020 12:35:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXeU8TnHsD32a81FfoXZ6J/Z4GwOHoFYlQuw6KGpYMM7k9uymEO8sGajrlC1RUxiL+HgTl X-Received: by 2002:a50:fe82:: with SMTP id d2mr10688435edt.86.1599766556836; Thu, 10 Sep 2020 12:35:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599766556; cv=none; d=google.com; s=arc-20160816; b=P3x+pPkYtK980ygfaXeAoDT2AKXZCELRNCQ8W3YT4tGVImOL5mXAorO6u+8PXagV+I LQ9qpfifITyMCH2C5+X5GGcy5ZiEfB5QkzFmG6rJ2ue6BiKygOiqMwe7SGD2jwj6Rp52 aT90crTu1qumtaIpbIZOQPGop3fSpvGAwZFNYOb1JCc87a4e3e6AXHNzEb9GKmNVpCEr dbPcffirjfodhhbRKy8Gigic3j14J3DJsemcVwW4Xn6lqfovpH+Ug7X0UZJUVGRWGg0B z1oj3g+a+J/SKa/7W9FYYjgcByfFn1sHJPlAaiLzAcIJ6Hs7eUsf3kCOnahkJ6nTi5qI Uosw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=nTbGWidANXm2pjjCI9iaMQBY/df45EdumvXop+9a4ao=; b=sRsazKmEBD0TQfo1aRndsVNhdFRhNwiKlNg65U9AsZG2YuzKOphOWABy4zMxUweimK o4FEnKLxvDI7ejA/gKtC9EXbnmxOvszITeUViKkEph/hENN+lpZ4/NzaNlG8ZbND7Jc/ 7yOVjN5CrQ6q/21VN85PapJLTDm1nwpESp/8YuVJm3amoULvNvyFD5nE7c1x6SS7Mq5T NIWV0CIyBmL8fkLHlr20KU6Zj+hMyrQC6aJTn51UbpeeCyQ6QVVSpbQtU6KdSo/k4PUR bRHfmprBlRL8ryxv5wsBH7HuvnGW1p77LCqDIF8GP2wnyAVd26XoGexAk5cmohbZHz9b YyaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=gkhGKJWF; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o16si4270598ejr.517.2020.09.10.12.35.33; Thu, 10 Sep 2020 12:35:56 -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=@linux-foundation.org header.s=google header.b=gkhGKJWF; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727800AbgIJTc6 (ORCPT + 99 others); Thu, 10 Sep 2020 15:32:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728023AbgIJTcb (ORCPT ); Thu, 10 Sep 2020 15:32:31 -0400 Received: from mail-lj1-x242.google.com (mail-lj1-x242.google.com [IPv6:2a00:1450:4864:20::242]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6710BC061756 for ; Thu, 10 Sep 2020 12:32:24 -0700 (PDT) Received: by mail-lj1-x242.google.com with SMTP id k25so9731430ljk.0 for ; Thu, 10 Sep 2020 12:32:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=nTbGWidANXm2pjjCI9iaMQBY/df45EdumvXop+9a4ao=; b=gkhGKJWFcLTHyB5x5aFfN6rnXH8dCRqQWjJKd9NZmHZK/NC/oX0q6HVDmBmeekhRv6 GTPYMsgUuX5KTeHU91CyIJtiMizZNYrRnX9QG0ENhdKweAOaB0W4mGxVSrji+PC28UP6 VshPJp7YLq+DwXcjz/A/kXWDuc/ae+MhCxRmA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nTbGWidANXm2pjjCI9iaMQBY/df45EdumvXop+9a4ao=; b=c2ZH5sV/Mm0/NWAhnFLpVnUe2pD1GcaIgJcKi+ImIef/K1YmOiCCI31tCzecQTpcOH hUgHjlttlQ+vkz2MuH68Dmt9ULdUcBSwUHHoZWW0FOhTb1oUT5PDSHJLoeBE7/0XRixZ SDYILq8it4iaWA+sVo0soPQJfvH7m5xbp+X3m5Ig6dpATAYGiRDMhq95Nm0k55L9e6SF X9Rusg9H27kRny5rgS8+meGmc+h6AV9m/vYxUeQweI1smyxJElFZ+vrj16aXcf9l+rE1 xSPoLBGXjYdSIsmKG0ykBbbljkoZ1CUKGfpSmUhjLV11BMSebKiAweSUfvZfn4y08NyU pPqw== X-Gm-Message-State: AOAM530HmLBW4voBmTvorr9z/XEPlEAIZHLw/MEjSR6t9Fo2rs73316/ SbvdjBySIcTIAmUDzIHHEkTlqVOpK+svdA== X-Received: by 2002:a05:651c:107b:: with SMTP id y27mr4844962ljm.338.1599766342760; Thu, 10 Sep 2020 12:32:22 -0700 (PDT) Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com. [209.85.208.179]) by smtp.gmail.com with ESMTPSA id v25sm1821740ljh.102.2020.09.10.12.32.22 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 10 Sep 2020 12:32:22 -0700 (PDT) Received: by mail-lj1-f179.google.com with SMTP id y4so9669671ljk.8 for ; Thu, 10 Sep 2020 12:32:22 -0700 (PDT) X-Received: by 2002:a2e:7819:: with SMTP id t25mr5043564ljc.371.1599766341582; Thu, 10 Sep 2020 12:32:21 -0700 (PDT) MIME-Version: 1.0 References: <20200907180058.64880-1-gerald.schaefer@linux.ibm.com> <20200907180058.64880-2-gerald.schaefer@linux.ibm.com> <0dbc6ec8-45ea-0853-4856-2bc1e661a5a5@intel.com> <20200909142904.00b72921@thinkpad> <20200909192534.442f8984@thinkpad> <20200909180324.GI87483@ziepe.ca> <20200910093925.GB29166@oc3871087118.ibm.com> <20200910181319.GO87483@ziepe.ca> <20200910211010.46d064a7@thinkpad> In-Reply-To: <20200910211010.46d064a7@thinkpad> From: Linus Torvalds Date: Thu, 10 Sep 2020 12:32:05 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH v2 1/3] mm/gup: fix gup_fast with dynamic page table folding To: Gerald Schaefer Cc: Jason Gunthorpe , Alexander Gordeev , Dave Hansen , John Hubbard , LKML , linux-mm , linux-arch , Andrew Morton , Russell King , Mike Rapoport , Catalin Marinas , Will Deacon , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Jeff Dike , Richard Weinberger , Dave Hansen , Andy Lutomirski , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Arnd Bergmann , Andrey Ryabinin , linux-x86 , linux-arm , linux-power , linux-sparc , linux-um , linux-s390 , Vasily Gorbik , Heiko Carstens , Christian Borntraeger , Claudio Imbrenda Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 10, 2020 at 12:11 PM Gerald Schaefer wrote: > > That sounds a lot like the pXd_offset_orig() from Martins first approach > in this thread: > https://lore.kernel.org/linuxppc-dev/20190418100218.0a4afd51@mschwideX1/ I have to admit to finding that name horrible, but aside from that, yes. I don't think "pXd_offset_orig()" makes any sense as a name. Yes, "orig" may make sense as the variable name (as in "this was the original value we read"), but a function name should describe what it *does*, not what the arguments are. Plus "original" doesn't make sense to me anyway, since we're not modifying it. To me, "original" means that there's a final version too, which this interface in no way implies. It's just "this is the value we already read". ("orig" does make some sense in that fault path - because by definition we *are* going to modify the page table entry, that's the whole point of the fault - we need to do something to not keep faulting. But here, we're not at all necessarily modifying the page table contents, we're just following them and readign the values once) Of course, I don't know what a better name would be to describe what is actually going on, I'm just explaining why I hate that naming. *Maybe* something like just "pXd_offset_value()" together with a comment explaining that it's given the upper pXd pointer _and_ the value behind it, and it needs to return the next level offset? I dunno. "value" doesn't really seem horribly descriptive either, but at least it doesn't feel actively misleading to me. Yeah, I get hung up on naming sometimes. I don't tend to care much about private local variables ("i" is a perfectly fine variable name), but these kinds of somewhat subtle cross-architecture definitions I feel matter. Linus