Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1190095ybn; Wed, 2 Oct 2019 12:11:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqw9hFg7KdWyMXgdWmaaAqrbwh2IuYHzCyvpe2UK6QwnNGeX1AhdOV3/iPzuwyezsc9gU25X X-Received: by 2002:a17:906:af57:: with SMTP id ly23mr4416693ejb.269.1570043469594; Wed, 02 Oct 2019 12:11:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570043469; cv=none; d=google.com; s=arc-20160816; b=l7o1OBmvUMo960NWUcZ/W8Tva1MKt0GwGN5SsRYregqAddwcoXJ1Nwk282eDz/g3pu s4fea8xldf6o396MOxks/T5EIlzvxeCnEwYpWJt8xA/VX3JhHP7o3vJWCAEZxMFjpLuz 27JtjIV/4/LwbG94lTlvQn7/s8JKHoVFSYz0Qw8RJ4ZIjFX+BAZw7+qPAMWeQ314kFFP yUxI+UHiNH/x8qqOahWrUVGuv3+YbLPbVLa8ihDgEK+JVTPscF/Vl9ENQz3GIBJl2gaD hqYiQjZbiXg2A0qeohCSzlWRBJ7plkCHJU/elqzzrt/Q0UiKYRfcn1cSP5j+gTCxIPid GEnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject :dkim-signature; bh=OhmPtilNL9Mju1atXD57vS5XPPiVOGcywNMz6cCNTbQ=; b=OF4b7iLo9mrsQMQ9W5TnASiJYWz+OdMzlLSIjnYVDL0eOzOpwe9GqrDponsdPjgjLS wkJujmf9wFmVF+qz3Ugvj8mpbRLe8TDSyBUUSAw1bi1APHjVxTFfD/1uJzNp5DUGVMDn pW72KZ6Mixp/z1049oGoZ5305pbaIgyQLYjt38tbUwD4fk7SC+UqY7MTJvo2g4dbNhAH NOXU53ndQLb0SsS5JbbypvrtgfAfGqKWiHTsznWqkYSt3Lt2fwrjHboJ+uJjt28Nup7k mLrYVSR7mY2mqDJSBj/k5CKZ7+D410Oxo4dToSHr5L9rVxLB7yW9MwvyTGxC8gA0otqW tZdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@shipmail.org header.s=mail header.b=Vv50zyjE; 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 z10si30103edx.168.2019.10.02.12.10.44; Wed, 02 Oct 2019 12:11:09 -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=fail (test mode) header.i=@shipmail.org header.s=mail header.b=Vv50zyjE; 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 S1729696AbfJBTJu (ORCPT + 99 others); Wed, 2 Oct 2019 15:09:50 -0400 Received: from ste-pvt-msa1.bahnhof.se ([213.80.101.70]:36064 "EHLO ste-pvt-msa1.bahnhof.se" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729337AbfJBTJs (ORCPT ); Wed, 2 Oct 2019 15:09:48 -0400 Received: from localhost (localhost [127.0.0.1]) by ste-pvt-msa1.bahnhof.se (Postfix) with ESMTP id BDE753F31A; Wed, 2 Oct 2019 21:09:45 +0200 (CEST) Authentication-Results: ste-pvt-msa1.bahnhof.se; dkim=pass (1024-bit key; unprotected) header.d=shipmail.org header.i=@shipmail.org header.b=Vv50zyjE; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at bahnhof.se X-Spam-Flag: NO X-Spam-Score: -2.1 X-Spam-Level: X-Spam-Status: No, score=-2.1 tagged_above=-999 required=6.31 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1] autolearn=ham autolearn_force=no Received: from ste-pvt-msa1.bahnhof.se ([127.0.0.1]) by localhost (ste-pvt-msa1.bahnhof.se [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id VgvaLYn_a4rC; Wed, 2 Oct 2019 21:09:44 +0200 (CEST) Received: from mail1.shipmail.org (h-205-35.A357.priv.bahnhof.se [155.4.205.35]) (Authenticated sender: mb878879) by ste-pvt-msa1.bahnhof.se (Postfix) with ESMTPA id 0B70E3F247; Wed, 2 Oct 2019 21:09:41 +0200 (CEST) Received: from localhost.localdomain (h-205-35.A357.priv.bahnhof.se [155.4.205.35]) by mail1.shipmail.org (Postfix) with ESMTPSA id 20E7036005C; Wed, 2 Oct 2019 21:09:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=shipmail.org; s=mail; t=1570043381; bh=un9Yli6t+rpUOQrchmJq2mc/5qmOJ2r/ZU8Lu7dWySs=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=Vv50zyjEH94ORp4kXZ+FlQiRtzGFnTsl5Oj1OPFHbWYQApu4nh74c4WjqkEPdCxtV NGuOhQVfYQSTsXzmy927FMiSXbUIunG2gIf6kzqFKRGk/8iTcmH1cF7vMLbTmHLS4e Lz+7feRjwvV6itx+zr37L1X8S00HCTcyw5/U5RUg= Subject: Re: [PATCH v3 3/7] mm: Add write-protect and clean utilities for address space ranges To: Linus Torvalds 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" References: <20191002134730.40985-1-thomas_os@shipmail.org> <20191002134730.40985-4-thomas_os@shipmail.org> From: =?UTF-8?Q?Thomas_Hellstr=c3=b6m_=28VMware=29?= Organization: VMware Inc. Message-ID: <516814a5-a616-b15e-ac87-26ede681da85@shipmail.org> Date: Wed, 2 Oct 2019 21:09:40 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/2/19 8:06 PM, Linus Torvalds wrote: > On Wed, Oct 2, 2019 at 6:48 AM Thomas Hellström (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 Yes I typically tend towards using a "namespace_object_operation" naming scheme, with "as_dirty" being the namespace here, But I'll give it a shot to see if I can rename it more in line with the above. Looking at Matthew's suggestion but lining up with "unmap_mapping_range()", perhaps we could use "clean_mapping_range" and "wp_mapping_range"? Thanks, Thomas