Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp746200pxb; Tue, 3 Nov 2020 11:20:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJw/dFo65qoR1IacFoPCUQdNb3npHTWCtzsBZt6aXDdR6okUuwh+myywa1XGXzgp4av3aoij X-Received: by 2002:a17:906:1708:: with SMTP id c8mr2298247eje.134.1604431237533; Tue, 03 Nov 2020 11:20:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604431237; cv=none; d=google.com; s=arc-20160816; b=BgUa122J9Gu+gNAaNxkeFJ1qFWuoaDXu2L+rMK3OqKnzSBuM1eNixdqLxwGLNCb8fi ZucpNxuAzDP2E/1QwEzDxmb7tF/hQAOa2lh13j2PayE1IuINqbVnmP+ar5BNQFI1wo3l iNwuLWTPhzyuzXevkI1P0HHq7VSBHhHgaw/f9uLqFpd0Nd4709L6N0jYMUs5ajF4yJb+ 4Yo9sIutTXRcc1o3+epBg+zqQFJx56IRVcwGFc+ZRoT87B2WSFVytkm4mzzGhyL7+qNy PFrJ7h1WwebhQUohtp9Se6qcDR0QQk5kzSpDw4Z6+wk8FxvSHn54nsCc2PrVoFvWF0LO CoOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=+CPAgnnyqw7VL/JoIR0Kx+j9vZxF1jTOALVKJZvaioQ=; b=wonXKfY//jU02iDy7XSqxYoHUslXgE5MCGNb+9T3LWpxj/u614vNLgSLjlDczuz/p1 /hzvpZ5NVSpRtTQ0Hzc4cUNNXvnkxJ5FZHD9OdHhTYHko/Xof+4kK+0DS6TMvZF0kNTd tIRpjTIzXFtBrt/D/kAlclYWwgoGSUu6OIiOyTsULZFsE/62z7U4CXo3m3HSnGQDW8wN M2kFIej/xTfD4s19xzMfgn+CqDfyS+QyvjUCN7sFL/jciCoLryutQKHIxDZ4IxLbc7zd EIQakB1gWGHBCBkkZtAscfj1IuDxeWHTLK2E1HUDt5MO+jo/V4m/JxDPRC3G1zezqPf7 fy0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=Z035LvsY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b6si13643122edv.126.2020.11.03.11.20.13; Tue, 03 Nov 2020 11:20:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=Z035LvsY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729399AbgKCTSu (ORCPT + 99 others); Tue, 3 Nov 2020 14:18:50 -0500 Received: from hqnvemgate24.nvidia.com ([216.228.121.143]:6985 "EHLO hqnvemgate24.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729087AbgKCTSu (ORCPT ); Tue, 3 Nov 2020 14:18:50 -0500 Received: from hqmail.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate24.nvidia.com (using TLS: TLSv1.2, AES256-SHA) id ; Tue, 03 Nov 2020 11:18:52 -0800 Received: from [10.2.49.167] (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Tue, 3 Nov 2020 19:18:49 +0000 Subject: Re: [RFC PATCH resend 3/6] mm: Add refcount for preserving mm_struct without pgd To: Jason Gunthorpe , Jann Horn CC: Andrew Morton , Linux-MM , Eric Biederman , Oleg Nesterov , kernel list , Will Deacon , Kees Cook , Ingo Molnar References: <20201016230915.1972840-1-jannh@google.com> <20201016230915.1972840-4-jannh@google.com> <20201016232153.GD37159@ziepe.ca> <20201103132127.GK36674@ziepe.ca> From: John Hubbard Message-ID: <4f428d8e-b660-9e31-6968-b28f6d7088f5@nvidia.com> Date: Tue, 3 Nov 2020 11:18:49 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20201103132127.GK36674@ziepe.ca> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1604431132; bh=+CPAgnnyqw7VL/JoIR0Kx+j9vZxF1jTOALVKJZvaioQ=; h=Subject:To:CC:References:From:Message-ID:Date:User-Agent: MIME-Version:In-Reply-To:Content-Type:Content-Language: Content-Transfer-Encoding:X-Originating-IP:X-ClientProxiedBy; b=Z035LvsYyiQh+Qrrs6mbfgKqZHCU4WAXlib5do+P2G30AYSolgzcwkc19NpY61nAc Y/ZmcmVUOabb4GLDzhrHM7bSHSIHdCFs6341uFVB5AMF/rzOj1t9S76lrSYV9M/NQe 22APW7CcQTQzEQ//2jwsYkfs49RuZZmGU5F02CKhaWp6fcgcNrLgjwZLMj+Bs0MIvR p5cZOutussLxBCurITL0hshae9TYDEqmRj43Egpry0X5IWWDM4APrbBjHCKiTH7cJx RRhfQYWsOsNzmJrnUan7JSjrgNjlr3r0+kDzmaMB86s3jLVmlEhnx3hm4Ll8cX+yxS ISc4zlZswZGOQ== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/3/20 5:21 AM, Jason Gunthorpe wrote: > On Tue, Nov 03, 2020 at 04:19:11AM +0100, Jann Horn wrote: >> On Tue, Nov 3, 2020 at 3:11 AM Jann Horn wrote: >>> On Sat, Oct 17, 2020 at 2:30 AM Jann Horn wrote: >>>> On Sat, Oct 17, 2020 at 1:21 AM Jason Gunthorpe wrote: >>>>> On Sat, Oct 17, 2020 at 01:09:12AM +0200, Jann Horn wrote: >>>>>> Currently, mm_struct has two refcounts: ... > Either way can work, I liked the suggestion because it suggests an > good name for the ref: 'mmget_pgd' or somesuch > > What I don't like is how nonsensical the names here are becoming: > mmget/mmgrab/mm_ref > > Gives no impression at the callsite what is right/wrong > > Names like this: > mmget_struct > mmget_pgd > mmget_tables > What?! I had just resigned myself to a bimonthly exercise, re-memorizing the mm_struct naming correlation between grab, drop, get, put, count, and users. And now you want to make it directly understandable? :) > Make alot more sense to me.. > > I think this patch needs to do something about the naming.. > A third counter also seems like the tipping point, to me. thanks, -- John Hubbard NVIDIA