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=-0.9 required=3.0 tests=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 F2AECC10F14 for ; Wed, 2 Oct 2019 18:07:04 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A1F1821848 for ; Wed, 2 Oct 2019 18:07:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="Dh2G8GYr" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A1F1821848 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 38E416B0003; Wed, 2 Oct 2019 14:07:04 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 319306B0006; Wed, 2 Oct 2019 14:07:04 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1E0776B0007; Wed, 2 Oct 2019 14:07:04 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0210.hostedemail.com [216.40.44.210]) by kanga.kvack.org (Postfix) with ESMTP id EB6E56B0003 for ; Wed, 2 Oct 2019 14:07:03 -0400 (EDT) Received: from smtpin14.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id 6FFA3824CA3A for ; Wed, 2 Oct 2019 18:07:03 +0000 (UTC) X-FDA: 75999625926.14.paste95_5a9e36f3b0835 X-HE-Tag: paste95_5a9e36f3b0835 X-Filterd-Recvd-Size: 5679 Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com [209.85.208.195]) by imf17.hostedemail.com (Postfix) with ESMTP for ; Wed, 2 Oct 2019 18:07:02 +0000 (UTC) Received: by mail-lj1-f195.google.com with SMTP id 7so18102536ljw.7 for ; Wed, 02 Oct 2019 11:07:02 -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:content-transfer-encoding; bh=LI8YD1l9wWpd4czC3TbcOWwWakrV1Iiw4AlgOzqD4sc=; b=Dh2G8GYr8EPvelOroqLSHC/KxuCKYDezy/8X2VOtg5D0e92mG2pHLP70TqaN2AfR9k 0nLutEeynYTet4qiWK21uAUE+bdD6KLHao28LPAqwhOGZo7KVaP2s21u92x8UDfJvlon JS/hqGTaum4haQPegZco3tzb8IrjpJe1sLu54= 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:content-transfer-encoding; bh=LI8YD1l9wWpd4czC3TbcOWwWakrV1Iiw4AlgOzqD4sc=; b=d1CPXpK3E7BUO2BQKRfgFm2RV2jTanBl432e/fQslIbWfmVy4LCJfhheRd8SGPUUGQ 8uPpDlq8bTapkq7BVV8DLxil7tgODewZprDLZKeKoOsED0TuXdgXQrmuuwpIQEIZAXdg zU4ghZCtTQcP6Gof50U/b+6x9qIZxhlCiJRrHtAqt2XVCYXrTQL8bqxrtoYoEJpGSb2d XJfCrBKZPupaDo1qvgZoi16v0/wlO/ZGjQy+jD+JDrJBDEfGaRZVERvi7Z7uum5RbX3c 17Wvb8PEdxyMKbPvH/6iGbkekDF6Ez8KyTR5Xe7odJDJFAS6P+q9xjnsx0d/QPz8P/Ku B9Tg== X-Gm-Message-State: APjAAAX1EDkKtJfpwRH3GCwLdv6/fXnAL/ZLtreZvJ1WhK7lSOLrpjil c1PctLl6Dyfppx/exTXqHjmVfcVPOec= X-Google-Smtp-Source: APXvYqw6cl/ERXeTc4Bk7QSzLXCO1vGGS5CBsovAKHeH/+naS1CO1v1BsIH+QoIBuAfkkt91ljLQnQ== X-Received: by 2002:a2e:761a:: with SMTP id r26mr3307222ljc.137.1570039620662; Wed, 02 Oct 2019 11:07:00 -0700 (PDT) Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com. [209.85.208.172]) by smtp.gmail.com with ESMTPSA id 202sm30144ljf.75.2019.10.02.11.06.59 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Oct 2019 11:06:59 -0700 (PDT) Received: by mail-lj1-f172.google.com with SMTP id v24so18127556ljj.3 for ; Wed, 02 Oct 2019 11:06:59 -0700 (PDT) X-Received: by 2002:a2e:551:: with SMTP id 78mr3405968ljf.48.1570039619077; Wed, 02 Oct 2019 11:06:59 -0700 (PDT) MIME-Version: 1.0 References: <20191002134730.40985-1-thomas_os@shipmail.org> <20191002134730.40985-4-thomas_os@shipmail.org> In-Reply-To: <20191002134730.40985-4-thomas_os@shipmail.org> From: Linus Torvalds Date: Wed, 2 Oct 2019 11:06:43 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3 3/7] mm: Add write-protect and clean utilities for address space ranges To: =?UTF-8?Q?Thomas_Hellstr=C3=B6m_=28VMware=29?= Cc: Linux-MM , Linux Kernel Mailing List , Thomas Hellstrom , Andrew Morton , Matthew Wilcox , Will Deacon , Peter Zijlstra , Rik van Riel , Minchan Kim , Michal Hocko , Huang Ying , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , "Kirill A . Shutemov" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 Wed, Oct 2, 2019 at 6:48 AM Thomas Hellstr=C3=B6m (VMware) wrote: > > From: Thomas Hellstrom > > Add two utilities to a) write-protect and b) clean all ptes pointing into > a range of an address space. This one I still don't exactly love. I'm not entirely sure what rubs me the wrong way, but part of it is naming. We don't use the name "as", because it reads as (sic) an English word. The name we use for address_space pointers is "mapping", both for variables and for existing functions. See for example "pte_same_as_swp()" which uses "as" as the _word_ 'as'. Contrast that with "unmap_mapping_range()" or "mapping_set_unevictable()" or "read_mapping_page()" or "invalidate_mapping_pages()", that all work on address spaces. So please don't use 'as' as shorthand for that - eithe rin the function names or the filename. I'm not sure if that's the _only_ thing that raises my heckles when I read this patch, but I think it might be. So I'm not saying "ack with naming change", but I suspect that if the naming was changed, it would look much better to me. Yes, it's a bit more typing. But I really think "clean_mapping_dirty_pages()" is just not only more in line with the mm naming, I think it's a lot more legible and understandable than "as_dirty_clean()", which just makes me go "what the heck does that function do?" And I really think it needs more than just "as" -> "mapping". "mapping_dirty_clean()" still makes me go "what?" in a way that "clean_mapping_dirty_pages()" does not. One name reads as a series or random words, the other reads as a "this is what the function does". I know I sometimes get hung up about naming, but I do think naming matters. A descriptive name that just reads as what the function does makes it much easier to read the logic of code, imnsho. Linus