Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1121436ybn; Wed, 2 Oct 2019 11:09:24 -0700 (PDT) X-Google-Smtp-Source: APXvYqyWJK1NoGkPBmrgsz63g7jk7Vd9jik04ggUHWEVxsw3093GA8RK9/NExuxOoo6eD3qnM2nM X-Received: by 2002:a17:906:f846:: with SMTP id ks6mr4283122ejb.192.1570039764833; Wed, 02 Oct 2019 11:09:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570039764; cv=none; d=google.com; s=arc-20160816; b=W4in8Exv6lM3Qa+oxz0z94voQ6tibYLEh/Ci8m+bIVq5+vYRFx/ZLS1ult3gwN+bLd 4dZh5TJaMRLfB1yXS6vceh1zXNVHWB1oork9ZSzcelLRXLi+mOA9hDC9Sw43sIVMg5zm tBn/MmwLZV9pjUO2wAJ8Vs6r59DbqXXiqNYqvn9kb2vmhUvAgnl94yLHmHLQ39d04anr qV6cVdu+6+zpmscc3ThSiqGFRG2ofYFqedt6qs7epxKwd7SjkA5NLk4z2T1+glq4s3YD a0Mp5eObDbCIldQbdzUrxZyNctLw3EvVWJ0nxwnjhMu+gUPwtxjH43iMFSckuwQ81yNF 6+RA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=LI8YD1l9wWpd4czC3TbcOWwWakrV1Iiw4AlgOzqD4sc=; b=ER7x+3YzxSuuNoW3gj9P5P/7dlIyC7ERjpPb8q/TyrG03vUSJvC4IS6mg5omYpFb+1 3dPImbmFifhAmFK6b+wiUT+JY1CPePsDnWcmUcXbvZ/X5mgyv44kJNvkFRMWv5xKDi9w 64sNWDvJZYNzFH6yvQIhUQEV1LfpFcmdE54BvPCAPMfXgrW5n5ZrMMo+fTa7O7OHVwQK 9W2dvlNy8YtM7UOp6G6z9/ywBiONMb/C1Ve5woGzvD7csXVy5U3IXnhQ/+mlyyW/bthP cbZ76GORgjpHBeDUuabmB5LbwVJGJHPHgi3n3spOODrdrrgPObMfG5ErGwWlsk85JmW4 Ggow== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=Dh2G8GYr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h28si12060193edh.278.2019.10.02.11.09.00; Wed, 02 Oct 2019 11:09:24 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=Dh2G8GYr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728213AbfJBSHF (ORCPT + 99 others); Wed, 2 Oct 2019 14:07:05 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:46980 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726669AbfJBSHE (ORCPT ); Wed, 2 Oct 2019 14:07:04 -0400 Received: by mail-lf1-f66.google.com with SMTP id t8so13380238lfc.13 for ; Wed, 02 Oct 2019 11:07:03 -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=jas+Q7bQhxIDEjXJlhT/g8KNboUar9d7UO/cbC3tL3AtYKuNE0uQ0qIcvG05R4oJKq OwJyAqBwfaTwHk3xWhGgkNHS3kYgW4CjUUA+l4tssm+3j4phua+EBwgk06Gy4U4x/6Gg /yZZcxG1ThupPBDhXRFbL/9SgEiYdiCmw2agdYLed5q3v3t63sIigB3rTXhqfZyzmAU+ YKROWpNIDRg+Pba8F4oPp3qNtKMAlCSG9c+pK9Vsip1bN+UQrb12pv2Myn7vuWULfYdG 7z6GmP1HkbXED3PuSxTXJF3Lnyj64DbE4teFtG7wSPCueY/eLsdlca8VzXXCSMmkF+Ji +/Lg== X-Gm-Message-State: APjAAAX0Erngrt89WvCnjgYKyRmgnS0LhQhNP26PQtwuCZrMIb0mGkbq cojGAJR6bIO/duHZgxZLS8VYqpaPmk4= X-Received: by 2002:a19:ee02:: with SMTP id g2mr3116243lfb.113.1570039622337; Wed, 02 Oct 2019 11:07:02 -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 s6sm31991ljg.43.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-f180.google.com with SMTP id m7so18137865lji.2 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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