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,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 44503C2B9F4 for ; Mon, 14 Jun 2021 18:32:27 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CF071611EE for ; Mon, 14 Jun 2021 18:32:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CF071611EE 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 164D76B006C; Mon, 14 Jun 2021 14:32:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 101F66B006E; Mon, 14 Jun 2021 14:32:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EBE646B0070; Mon, 14 Jun 2021 14:32:25 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0240.hostedemail.com [216.40.44.240]) by kanga.kvack.org (Postfix) with ESMTP id B7A386B006C for ; Mon, 14 Jun 2021 14:32:25 -0400 (EDT) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 4D9F1181AEF0B for ; Mon, 14 Jun 2021 18:32:25 +0000 (UTC) X-FDA: 78253174650.16.A93FB15 Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com [209.85.208.179]) by imf05.hostedemail.com (Postfix) with ESMTP id AC4B3E000279 for ; Mon, 14 Jun 2021 18:32:13 +0000 (UTC) Received: by mail-lj1-f179.google.com with SMTP id d2so21396000ljj.11 for ; Mon, 14 Jun 2021 11: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=FRy9wHmmQFf9BkfUMAjLFEyHdsKrABaf0OxZMcVrhPQ=; b=hC3SbZtI2MZo+gWwAmgSAP2SlFx8R7t5uV7TdsoNoz6MB8YSqJ61ekK/JxI0LWE42/ FzjXEDf8aQEsM2o+2px60W+7a/d9uKaSOPYPomoNWYCykdYQ89oEPmlgqkY11Kc38tiG mRzbNcOS8BOT31Ubd7aVunTJOFCbnTaNrP9tM= 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=FRy9wHmmQFf9BkfUMAjLFEyHdsKrABaf0OxZMcVrhPQ=; b=NvVXuP6YZ86vVUOnUVrNJ8k9FAbk791/TuQQ7b09V1rkQPxMxdSahuxU5+sqF3Ljix pZs37UUBXaIGzJPYKYmmg6sCvCPTDDhc7hFvfviN/gLrnFnlebPj98C41gc8ODT1/pfQ ctfUkcDRxKtjcj5wOago7DVW4lpZcJCXfyxhkHzuFYagPr32fYwxIUl384T6csQJluNg kngaNAApSsYW/wgC4bFYvP2KHAecUm1MPQkbuqFQKvAu8zC15LNG5+D+caije3IfccKK 3/os//6DH30lS2S2CQY/2ooJZMtu+7O4tkQ+McXwV80u0cAAzBLWJqT7cm1KUTyT+xvh 32qA== X-Gm-Message-State: AOAM5323g4uO0gkRTgR+qaqIe6nOjztaLfmf18YtN3nR5JuDiOyt8/ab 7uHhT3Q1ACHgSqb7tNOzMfyW5S037IvcyZ3Bbv0= X-Google-Smtp-Source: ABdhPJzq/FQ9jf5qT0hM+qSR82a+7otfEPRKWE/1+iddV+lPrIoWthIP1LaV7irTNjBfxFSuRVq+yA== X-Received: by 2002:a05:651c:3dc:: with SMTP id f28mr14584525ljp.294.1623695542363; Mon, 14 Jun 2021 11:32:22 -0700 (PDT) Received: from mail-lj1-f170.google.com (mail-lj1-f170.google.com. [209.85.208.170]) by smtp.gmail.com with ESMTPSA id z15sm56727lfr.116.2021.06.14.11.32.21 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 14 Jun 2021 11:32:21 -0700 (PDT) Received: by mail-lj1-f170.google.com with SMTP id n17so21529171ljg.2 for ; Mon, 14 Jun 2021 11:32:21 -0700 (PDT) X-Received: by 2002:a2e:b618:: with SMTP id r24mr9419541ljn.48.1623695541644; Mon, 14 Jun 2021 11:32:21 -0700 (PDT) MIME-Version: 1.0 References: <20210614110223.133678-1-aneesh.kumar@linux.ibm.com> <30cdb642-4419-a43f-0dbc-613e74a09338@linux.ibm.com> In-Reply-To: <30cdb642-4419-a43f-0dbc-613e74a09338@linux.ibm.com> From: Linus Torvalds Date: Mon, 14 Jun 2021 11:32:05 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/2] mm: Change pud_page_vaddr to return pmd_t * To: "Aneesh Kumar K.V" Cc: Linux-MM , Andrew Morton Content-Type: text/plain; charset="UTF-8" Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=google header.b=hC3SbZtI; dmarc=none; spf=pass (imf05.hostedemail.com: domain of torvalds@linuxfoundation.org designates 209.85.208.179 as permitted sender) smtp.mailfrom=torvalds@linuxfoundation.org X-Stat-Signature: nefs6oi9ec7r9fswd8i3a64urjngm451 X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: AC4B3E000279 X-HE-Tag: 1623695533-168328 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 Mon, Jun 14, 2021 at 4:30 AM Aneesh Kumar K.V wrote: > > while we are doing this, should we rename pud_page_vaddr to pud_pgtable > and p4d_page_vaddr to p4d_pgtable? I actually find the name > pud_page_vaddr confusing (is it the vaddr of pud page kind of confusion) I agree. The "vaddr" thing is only confusing - I think it was there exactly _because_ the return type was so odd, and because of historical implementation. IOW it was probably mostly due to the implementation issue of "we use __va() to generate the virtual address from a physical address that exists the page tables", and then that internal implementation thing because part of the naming because there was no conceptually good name for it. Now that it literally returns a pointer to a pmd_t, I think the "vaddr" is just a pointless and silly name - *of*course* it's a virtual address, it's a pointer! And it would be much more logical to say that it returns the (pmd-level) pgtable pointer of the pud entry, so yeah, "pud_pgtable()" seems conceptually fairly sensible to me. It's probably a good idea to do the "rename and change type" in one single patch. Not just because it changes the exact same lines, but because the whole "pick a new name when changing semantics" is generally a good idea in that it also makes compiler errors more obvious - type changes can otherwise be hidden by explicit casts etc. Linus