Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1136462ybz; Wed, 29 Apr 2020 15:45:13 -0700 (PDT) X-Google-Smtp-Source: APiQypKbmOIP3SKfRkntlaxX4YTmnrZguMusbqMa7avNBoNvN3K7uCL00uv2njX5vp2PWpQEQjhC X-Received: by 2002:a17:907:7246:: with SMTP id ds6mr40605ejc.203.1588200312929; Wed, 29 Apr 2020 15:45:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588200312; cv=none; d=google.com; s=arc-20160816; b=krt56W1l5GlB9F7nkO7ReoeOnNSan70p2io7cAk9UzloVWDPzQgRMCu73NsMXaZ5u3 OazpfKPxMCCyLYVM0ACxG8TXEwqkmQ+OxB3tG7ONmk3LtaQcx1SUnw/RNXqKEd1096vv 0pv3uyfNKG5wd8Gw7FQfBwDHy+ry7ipGHE1a8IlcFGTTtcH5RYsuA/LjYKP+qqULWtjd QwmX8vPXmpUAfw7u7W8+Q/CDcpXQoYswnj8hPkcPJZuwOsQv+qPLzlgLkz8qSMH2Ihcp 9kmc7nzM2oT5HYwv2KF59NSv7t7xKWLYzDCC2GYDNqlRoT2n8HCIo6eBhp3XfDjzNwAP 321Q== 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:dkim-signature; bh=yBgZcrV4iWdwc8bXr1UgNLaniSphIyQASgPqncouw5A=; b=jZQcWJOjtrCbMVrPhIYbKhDtrEaeZvIFMepVWOViDAGQ6LREPihGgTuZmAuJich3oi I1EXlh0x8P07kS1uqVKbBlFMipV59tB29d3wBp5XotubxIqNvVoAsXZJjhUHPw1vCdLJ 1xoJlaWlckjpr2fkC1KGjBcipFtzq4sf86Q+b6DPfkYkeAkSuQ+WTaVBmYHjdRru3ewP 8qRVKHIHffdH8MCuJSPJfbgCMAqzNYB6Y7WJetLDTcwCoBUX5dQ/eUionQDktyP1C3l6 y3acfD2fOf5SnzWzfi6yDU1UcbE0aK/cFo9o60QFaAvgb1LmU+HMvIupfbjLb9xlEb4x hGOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=f12ZywN6; 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 w10si4793258ejn.246.2020.04.29.15.44.49; Wed, 29 Apr 2020 15:45:12 -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; dkim=pass header.i=@ziepe.ca header.s=google header.b=f12ZywN6; 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 S1727095AbgD2Wla (ORCPT + 99 others); Wed, 29 Apr 2020 18:41:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726164AbgD2Wla (ORCPT ); Wed, 29 Apr 2020 18:41:30 -0400 Received: from mail-qk1-x742.google.com (mail-qk1-x742.google.com [IPv6:2607:f8b0:4864:20::742]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DCD23C03C1AE for ; Wed, 29 Apr 2020 15:41:29 -0700 (PDT) Received: by mail-qk1-x742.google.com with SMTP id l78so3844283qke.7 for ; Wed, 29 Apr 2020 15:41:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=yBgZcrV4iWdwc8bXr1UgNLaniSphIyQASgPqncouw5A=; b=f12ZywN6K7/T0vh/KFA3gH3gfK1sZ3o1eqim7onv3KljZBN4EOi4bv6G5V+XbG4ut1 QQLVUyAfs4arAjqaqFVeMkgjxNn40gaGCjoQ7o0T29H6bsy2WzWeCqi+bO3ZRddrrCIx ZpoSV5qQBQZnrndmt08qcR/DcYoVpUDmC5hY7V0oWPPMSFSPw5y5/KRbFoEpmjdnydS9 baSt1dM3SYcyQ1N3yyIRPCOPHVdxSN8akC48vdq9aPEUZEPCm7Q2lckDBnXUDRGzXwp2 4bh9Wy/0+rhTYdXvbRRxtmS5bIVA54WQzEwFvGgqOS4DEMnxOYBSpNngwveCYRtgj0jf jg8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=yBgZcrV4iWdwc8bXr1UgNLaniSphIyQASgPqncouw5A=; b=HsAkIpz65YCgwtz0SyFEQszaRyAOX8/s4qUOjuDPSXq6RsOT8SzVx1DLGK3SyshwCx w0s3PfKhWP3kXTsR2BVa0z0sl8iz1gMIHYui9jvycXIqvh9gL6QFLi+DRlYVtgQtr53t g/70qx4GlRyZqnQe2wvfmPAFSvro3Df8o7TvR0WYQOBIDu8j4u5rcnWvfvEZu3Fe9R6a aBRiA8IWCjC+Saly+Ly+lq61TCJRRpcS9M5TTWwflgZRAXgA5MmuYWA/9KH1hjsHPsZw oA/xfoAisnXNGV7vBzqO604vX3vBDevcpDHJ3jaeQC4xWgLdDBuKPcEX83+tM9vF4o02 EDsQ== X-Gm-Message-State: AGi0PuYP3lff09uEqJJiPDvsw/+pAFJ8SelsWGNAthdHybggVuWOc/1B Z3PbORAekVjaVOzTp6X4KXw0HQ== X-Received: by 2002:a05:620a:1305:: with SMTP id o5mr811497qkj.222.1588200089029; Wed, 29 Apr 2020 15:41:29 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-142-68-57-212.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.68.57.212]) by smtp.gmail.com with ESMTPSA id v27sm551028qtb.35.2020.04.29.15.41.28 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 29 Apr 2020 15:41:28 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1jTvOR-0000GO-Rd; Wed, 29 Apr 2020 19:41:27 -0300 Date: Wed, 29 Apr 2020 19:41:27 -0300 From: Jason Gunthorpe To: Felix Kuehling Cc: linux-mm@kvack.org, Ralph Campbell , "Yang, Philip" , Alex Deucher , amd-gfx@lists.freedesktop.org, Ben Skeggs , Christian =?utf-8?B?S8O2bmln?= , "David (ChunMing) Zhou" , dri-devel@lists.freedesktop.org, Christoph Hellwig , intel-gfx@lists.freedesktop.org, =?utf-8?B?SsOpcsO0bWU=?= 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: <20200429224127.GB3824@ziepe.ca> References: <5-v1-4eb72686de3c+5062-hmm_no_flags_jgg@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) 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 01:52:32PM -0400, Felix Kuehling wrote: > [+Philip Yang] > > Am 2020-04-21 um 8:21 p.m. schrieb Jason Gunthorpe: > > From: Jason Gunthorpe > > > > Presumably the intent here was that hmm_range_fault() could put the data > > into some HW specific format and thus avoid some work. However, nothing > > actually does that, and it isn't clear how anything actually could do that > > as hmm_range_fault() provides CPU addresses which must be DMA mapped. > > > > Perhaps there is some special HW that does not need DMA mapping, but we > > don't have any examples of this, and the theoretical performance win of > > avoiding an extra scan over the pfns array doesn't seem worth the > > complexity. Plus pfns needs to be scanned anyhow to sort out any > > DEVICE_PRIVATE pages. > > > > This version replaces the uint64_t with an usigned long containing a pfn > > and fix flags. On input flags is filled with the HMM_PFN_REQ_* values, on > > successful output it is filled with HMM_PFN_* values, describing the state > > of the pages. > > > > amdgpu is simple to convert, it doesn't use snapshot and doesn't use > > per-page flags. > > > > nouveau uses only 16 hmm_pte entries at most (ie fits in a few cache > > lines), and it sweeps over its pfns array a couple of times anyhow. > > > > Signed-off-by: Jason Gunthorpe > > Signed-off-by: Christoph Hellwig > > Hi Jason, > > I pointed out a typo in the documentation inline. Other than that, the > series is > > Acked-by: Felix Kuehling > > I'll try to build it and run some basic tests later. Got it, thanks! Let me know if there are problems Jason