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=-3.9 required=3.0 tests=BAYES_00,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 68942C43461 for ; Thu, 10 Sep 2020 19:32:28 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E167621D81 for ; Thu, 10 Sep 2020 19:32:27 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="gkhGKJWF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E167621D81 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 455DE90000C; Thu, 10 Sep 2020 15:32:27 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3DEF1900002; Thu, 10 Sep 2020 15:32:27 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 27EB590000C; Thu, 10 Sep 2020 15:32:27 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0057.hostedemail.com [216.40.44.57]) by kanga.kvack.org (Postfix) with ESMTP id 0DB5C900002 for ; Thu, 10 Sep 2020 15:32:27 -0400 (EDT) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id BC63B82499A8 for ; Thu, 10 Sep 2020 19:32:26 +0000 (UTC) X-FDA: 77248148292.05.cough77_4e17069270e8 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin05.hostedemail.com (Postfix) with ESMTP id 934A81826B6B2 for ; Thu, 10 Sep 2020 19:32:26 +0000 (UTC) X-HE-Tag: cough77_4e17069270e8 X-Filterd-Recvd-Size: 6824 Received: from mail-lj1-f196.google.com (mail-lj1-f196.google.com [209.85.208.196]) by imf27.hostedemail.com (Postfix) with ESMTP for ; Thu, 10 Sep 2020 19:32:25 +0000 (UTC) Received: by mail-lj1-f196.google.com with SMTP id b19so9665675lji.11 for ; Thu, 10 Sep 2020 12:32:25 -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=apBCYk+DaxVcHOmB0adac/tbiCxcwyjX/OgCtEbrjH7af083zCifIssO6znxol6DwH o9lW8mjNwexON/LSnDTihxUuiFwccz5Elin7hQzNiuvvI83qgmSJAQBPfUUETDFu53/2 prUKBudBIRbFvNLrQ/OXEUZZJa1WYOGMc34gzuHVVpRkn3RKtoCE7QtrvZH8BfJ75coq 7o21DDUeEa5CjtRG0uxvch3e2A5MU/RNXjBm9MEw8Q/PXavdu9pINW18rpMxEZnR9Z6m NqM6SnpFIDmSAHt61pIbRrbKDWyIq0suV8Wfkv27yMpVHUR5IqvPHaJAeF7lo/n4lwCG 3+OA== X-Gm-Message-State: AOAM531dqVFTCO7qg3qmHSQPLhYRs8eM1PRV79+ZTOypmsQeXJoAymy8 qL6yKqAmt9Z5goz/H1Oxu2C5cn6NXsfV3g== X-Google-Smtp-Source: ABdhPJxMzE1gex73VfocBLTxDg7TVP36KAe7KTpkWirXOzhjvJI08+as4wlM7wqjCLq+k+FlnRbAxA== X-Received: by 2002:a2e:b531:: with SMTP id z17mr5738465ljm.30.1599766343402; Thu, 10 Sep 2020 12:32:23 -0700 (PDT) Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com. [209.85.208.180]) by smtp.gmail.com with ESMTPSA id u11sm1821851ljh.17.2020.09.10.12.32.21 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-f180.google.com with SMTP id w3so9707189ljo.5 for ; Thu, 10 Sep 2020 12:32:21 -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" X-Rspamd-Queue-Id: 934A81826B6B2 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 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 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