Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1496355ybz; Wed, 22 Apr 2020 23:15:04 -0700 (PDT) X-Google-Smtp-Source: APiQypKX67BgYt//vuaEDlKwFFLC+Q/845xUzrmb5WKrGZYHMRP63bEfizKtorMugoyrQBsf9gQ7 X-Received: by 2002:a17:906:31da:: with SMTP id f26mr1362922ejf.308.1587622504332; Wed, 22 Apr 2020 23:15:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587622504; cv=none; d=google.com; s=arc-20160816; b=F1TUU26LnfqHZbNsridXOw/jHp3nDfWdWU/rDKgyJZKGeNgCWWQLr0bBNqLGBj/DkD fUzixKJlxZ5RB9pEdLqPQyEhkmIIueMWopQabZVHsvMHUzn5u8yrcarZtlRVD9/+8DbC 3yR6Iv8Xk8RecxecJjCJtd6/l/ii0ZcK41E3MvIUjwoOk8BSpGwxtU48P2K7r7PATCCN sjWGDgsE4ZmGN1ANZ7J60lE/eFTos8i5xHIQ1GBDqSKmEFx/Ubd9jplmsXAgLsikLyH3 +l9NguMeZKOnc/DvTNy3FqNjjEbFLluRriSW4NyTS6k3dZfRKbsZ9vDV9QmibXzHYse8 KqtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=hQwOngGmwTvY7eA5qRSHCMcOFQtLU54ZSgirBKGCLGI=; b=FkIAJsf86fS9mf7FK+W1T9tztvGGTqemm5fZAf+hqBeDgOjqiWcnnddxZthPiO5QuM vdIxsJNaby3XcgIjDNGkXF11ossqu2rj5Uv528538+Yhg4KQltopXgXZalLTcnnRr+Gn d3iXMYjyaGn0tlrg0OPcFruwVJszbQlYSjT0FANsV0pbZ3kp3VhbYv/FFePPdhuD/zY8 3//Z9Sq803ILgFw3FCxXAgxJNNodAHog8QBxMv3xEXhfFGcKf8iK30jVA62/7dswJcGa xSWeJunBMgCanuc9XRpbPrrVWpgKUGCHJuI+SO/xaPppaixyK7C+8JU4wzgizyccYyIq 6d0g== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e9si678795eds.63.2020.04.22.23.14.41; Wed, 22 Apr 2020 23:15:04 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726821AbgDWGK2 (ORCPT + 99 others); Thu, 23 Apr 2020 02:10:28 -0400 Received: from verein.lst.de ([213.95.11.211]:56130 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725562AbgDWGK1 (ORCPT ); Thu, 23 Apr 2020 02:10:27 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id B47E6227A81; Thu, 23 Apr 2020 08:10:23 +0200 (CEST) Date: Thu, 23 Apr 2020 08:10:23 +0200 From: Christoph Hellwig To: Jason Gunthorpe Cc: Christoph Hellwig , linux-mm@kvack.org, Ralph Campbell , Alex Deucher , amd-gfx@lists.freedesktop.org, Ben Skeggs , Christian =?iso-8859-1?Q?K=F6nig?= , "David (ChunMing) Zhou" , dri-devel@lists.freedesktop.org, "Kuehling, Felix" , intel-gfx@lists.freedesktop.org, =?iso-8859-1?B?Suly9G1l?= Glisse , John Hubbard , linux-kernel@vger.kernel.org, Niranjana Vishwanathapura , nouveau@lists.freedesktop.org Subject: Re: [PATCH hmm 5/5] mm/hmm: remove the customizable pfn format from hmm_range_fault Message-ID: <20200423061023.GA9856@lst.de> References: <0-v1-4eb72686de3c+5062-hmm_no_flags_jgg@mellanox.com> <5-v1-4eb72686de3c+5062-hmm_no_flags_jgg@mellanox.com> <20200422060329.GD22366@lst.de> <20200422123911.GV26002@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200422123911.GV26002@ziepe.ca> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 22, 2020 at 09:39:11AM -0300, Jason Gunthorpe wrote: > > Nice callchain from hell.. Unfortunately such "code listings" tend to > > get out of date very quickly, so I'm not sure it is worth keeping in > > the code. What would be really worthile is consolidating the two > > different sets of defines (NVIF_VMM_PFNMAP_V0_ vs NVKM_VMM_PFN_) > > to make the code a little easier to follow. > > I was mainly concerned that this function is using hmm properly, > becuase it sure looks like it is just forming the CPU physical address > into a HW specific data. But it turns out it is just an internal data > for some other code and the dma_map is impossibly far away > > It took forever to find, I figured I'd leave a hint for the next poor > soul that has to look at this.. > > Also, I think it shows there is no 'performance' argument here, if > this path needs more performance the above should be cleaned > before we abuse hmm_range_fault. > > Put it in the commit message instead? Yes, the graph itself sounds reasonable for the commit log as a point of time information. > > > npages = (range->end - range->start) >> PAGE_SHIFT; > > > for (i = 0; i < npages; ++i) { > > > struct page *page; > > > > > > + if (!(range->hmm_pfns[i] & HMM_PFN_VALID)) { > > > + ioctl_addr[i] = 0; > > > continue; > > > + } > > > > Can't we rely on the caller pre-zeroing the array? > > This ends up as args.phys in nouveau_svm_fault - I didn't see a > zeroing? > > I think it makes sense that this routine fully sets the output array > and does not assume pre-initialize Ok.