From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5E836C83000 for ; Wed, 29 Apr 2020 22:41:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 286DE20BED for ; Wed, 29 Apr 2020 22:41:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="f12ZywN6" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727101AbgD2Wla (ORCPT ); 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-Google-Smtp-Source: APiQypLKqND0JKjNOfB6OKttFWw4PueCh+kW/uTm/J+/8LnYtWQ1Yu18biU6LtzJiRmM87wUIsCivg== 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