Received: by 2002:a25:5b86:0:0:0:0:0 with SMTP id p128csp1020898ybb; Thu, 28 Mar 2019 17:40:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqyqmuJAsdDD1OAlLEb0oAqjtX0lu5IrMvwGQ+i0HO+RT7g8mrBLC+EeMpDzqdi+PME3Hopz X-Received: by 2002:a17:902:e48c:: with SMTP id cj12mr21854468plb.93.1553820022617; Thu, 28 Mar 2019 17:40:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553820022; cv=none; d=google.com; s=arc-20160816; b=GD1fhX418OgbkhPIVblCFc49s1GPGQ4IdJJhhJ2VM/YZV2FBwZwbUfag8+P0hm5uEj FoEjKB4MNPchuqhFqi+RPRumLGVwuYR4arwf34PdrHn3/Hnop0vmONKE4MeI21rf2moJ 0bxpsy4B/GVL94azWVoj+opLd9Mm1I0D55wvkEWUjKsT9zlpmZm9DERXCh/uBBSrWIOp XQO1O8b6eaByMdNsNaCkM1XtSQr75/i+yym+qLdFfcFvmhBInaJkQSMmy4zQpqifT2yG 7+scwVjLOB3Ey0vECsvzXUkSyP7hoy3GowjffIBbQBI+OK59iNaHDwRIqVVGTrMsPuWi BP9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=tD7OqDvEuxyFdGL//3cLnWvjKrhcIjz2aOlgPkqRx0M=; b=liLmHSAmGpYpGQQ7Kpxz434MlL0rmd4aKDzVuYZ6EKUduGiaScBwiHx7Ymz/sJQd1c PDhTC6/lcbbLnWCUTTr+Xp7k8JkY+0UPMjtzv8wQG0/tOsz01gO2Yzqi/Rl1HlTVLQ5r wz1ieRXq0VgGALEhyIQZ78QBcaksN7jRt00y3Ma1mt0KH1cmfPFCQzBQlF+RnrtjZAno o70LhW4S/NM/3KSvDPUJoJjWLszDVX0GG9TbBi33Vm93DjY72VTRJbPRfE1dAObjfW9X G3lkZ764FiZAfb1Pu17HFqwsYadrQzsfTs6MZHkUCdT2ix8YWWTcNp8h7dVqXz9nJTJB A7Og== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=Q0KbVjt4; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r12si466018pfn.135.2019.03.28.17.40.04; Thu, 28 Mar 2019 17:40:22 -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=@nvidia.com header.s=n1 header.b=Q0KbVjt4; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728649AbfC2Aj2 (ORCPT + 99 others); Thu, 28 Mar 2019 20:39:28 -0400 Received: from hqemgate15.nvidia.com ([216.228.121.64]:15097 "EHLO hqemgate15.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728547AbfC2Aj1 (ORCPT ); Thu, 28 Mar 2019 20:39:27 -0400 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate15.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Thu, 28 Mar 2019 17:39:20 -0700 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Thu, 28 Mar 2019 17:39:27 -0700 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Thu, 28 Mar 2019 17:39:27 -0700 Received: from [10.110.48.28] (10.124.1.5) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Fri, 29 Mar 2019 00:39:26 +0000 Subject: Re: [PATCH v2 02/11] mm/hmm: use reference counting for HMM struct v2 To: Jerome Glisse CC: Ira Weiny , , , Andrew Morton , Dan Williams References: <20190325144011.10560-1-jglisse@redhat.com> <20190325144011.10560-3-jglisse@redhat.com> <20190328110719.GA31324@iweiny-DESK2.sc.intel.com> <20190328191122.GA5740@redhat.com> <20190328212145.GA13560@redhat.com> From: John Hubbard X-Nvconfidentiality: public Message-ID: Date: Thu, 28 Mar 2019 17:39:26 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.3 MIME-Version: 1.0 In-Reply-To: <20190328212145.GA13560@redhat.com> X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL101.nvidia.com (172.20.187.10) To HQMAIL101.nvidia.com (172.20.187.10) Content-Type: text/plain; charset="utf-8" Content-Language: en-US-large Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1553819960; bh=tD7OqDvEuxyFdGL//3cLnWvjKrhcIjz2aOlgPkqRx0M=; h=X-PGP-Universal:Subject:To:CC:References:From:X-Nvconfidentiality: Message-ID:Date:User-Agent:MIME-Version:In-Reply-To: X-Originating-IP:X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=Q0KbVjt4rsznaiVDmvDr6VuTjjWZ2rlv20UdubVR77Kk269lggejhWVS3cKh7MYkY w9593VJNWmESvoEmlkOW846WaJIbzc6nUiJMLCzFkZb7GGGhQ7SGaDH2SsaebT7TNu /LRNYJXErEJG+9i26NOGwgXAKU9h54GkWxEIdwAtiG3dMRVYjwLtrfjVy/hCCHKS6m MWm6e+PEQx5rt+xGQzNBueRM6zrDM1MnYEp8fHDA4uoYvMTPww2Lgdk7TykKEp/Q36 385PMGmrePqwnlUTkvmAJjZF1+3tUhXtfanKcV5TzHTYLAvslJjSuaAhkk4O7yjm/H GHjFIj7XgIAoA== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/28/19 2:21 PM, Jerome Glisse wrote: > On Thu, Mar 28, 2019 at 01:43:13PM -0700, John Hubbard wrote: >> On 3/28/19 12:11 PM, Jerome Glisse wrote: >>> On Thu, Mar 28, 2019 at 04:07:20AM -0700, Ira Weiny wrote: >>>> On Mon, Mar 25, 2019 at 10:40:02AM -0400, Jerome Glisse wrote: >>>>> From: J=C3=A9r=C3=B4me Glisse [...] >>>>> @@ -67,14 +78,9 @@ struct hmm { >>>>> */ >>>>> static struct hmm *hmm_register(struct mm_struct *mm) >>>>> { >>>>> - struct hmm *hmm =3D READ_ONCE(mm->hmm); >>>>> + struct hmm *hmm =3D mm_get_hmm(mm); >>>> >>>> FWIW: having hmm_register =3D=3D "hmm get" is a bit confusing... >>> >>> The thing is that you want only one hmm struct per process and thus >>> if there is already one and it is not being destroy then you want to >>> reuse it. >>> >>> Also this is all internal to HMM code and so it should not confuse >>> anyone. >>> >> >> Well, it has repeatedly come up, and I'd claim that it is quite=20 >> counter-intuitive. So if there is an easy way to make this internal=20 >> HMM code clearer or better named, I would really love that to happen. >> >> And we shouldn't ever dismiss feedback based on "this is just internal >> xxx subsystem code, no need for it to be as clear as other parts of the >> kernel", right? >=20 > Yes but i have not seen any better alternative that present code. If > there is please submit patch. >=20 Ira, do you have any patch you're working on, or a more detailed suggestion= there? If not, then I might (later, as it's not urgent) propose a small cleanup pa= tch=20 I had in mind for the hmm_register code. But I don't want to duplicate effo= rt=20 if you're already thinking about it. thanks, --=20 John Hubbard NVIDIA