Received: by 2002:a25:2c96:0:0:0:0:0 with SMTP id s144csp1080337ybs; Mon, 25 May 2020 06:45:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxk4iaky/XPDnxqt09iPC5wv+JgLXMuLqgslSn3m6VhMFDDHs/SPYUFnQTzbvEJc+UGQp/r X-Received: by 2002:a17:906:6893:: with SMTP id n19mr20281749ejr.354.1590414355864; Mon, 25 May 2020 06:45:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590414355; cv=none; d=google.com; s=arc-20160816; b=yW6IRpVrHk38DdrglJt01nr+QIbUOdCrkC33lhDJs8bTmmAWplQ1iglYXta3zJPZix EbszxrVfsekW1X69GNvifL3UzynOsbA6nFPVV30HkHvbf1PTl72Ci8bDZwgJ762EGm/Z Gco5xHgaYdp4BcIB2NgxRYyaodLZuv2lbA7uKlqxJArmwYynHaZQ3J6GPjhjNuVhgwE4 uJlKyctDDaYEgot2heS38t6k4gXZsey+q1ds3zyWFOv+n6L+XnyM6LWqVDRlDYFGyZu2 TBytpMHo2V+PNC5rJghuX1zopMz1+rcnLYJ2SQHKVfsvU8vDpGoF/t6GEygtUhUuRj1R JPvA== 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=gPDO3X5exveNuQB33sqGwYFDtLpn1MHpqh7qgx9Ds0U=; b=T/Oq8hVN9jWsA3hna67Q6qBGZhcf6IbpocAAnFUHiM+ghX/KghcTnUtJC1z52d71cH UrBTx/tN73t+bJSyaHEWxlRBi9sUIaNHsDQ0R4nk7HQaNeMxJp7buLThkKer2XJjHhwL fA9FcEISGVVXklvnFwX0jOaroxvAWBuXIl7RTeyrLF9QDGWq7gm4FYu+XwncPGoJQgp7 yhP4if7tFPK5DgfGOsuOB5i87+VYbIu0CcSRw4KmwW3BYg82HaQ8v68gWtVpuq6u+X7B yc17/jW+EWX6UslByNEbNSzLxItj+wbswe8Je4zWzVqfpPFx0j8vUZ+HeUvTIJLwbWbJ 2uSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=YWisdnil; 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 f22si8654209edx.79.2020.05.25.06.45.32; Mon, 25 May 2020 06:45:55 -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=YWisdnil; 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 S2390812AbgEYNlW (ORCPT + 99 others); Mon, 25 May 2020 09:41:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390752AbgEYNlV (ORCPT ); Mon, 25 May 2020 09:41:21 -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 6782BC05BD43 for ; Mon, 25 May 2020 06:41:20 -0700 (PDT) Received: by mail-qk1-x742.google.com with SMTP id f18so688377qkh.1 for ; Mon, 25 May 2020 06:41:20 -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=gPDO3X5exveNuQB33sqGwYFDtLpn1MHpqh7qgx9Ds0U=; b=YWisdnilIhfDrM+E+SxMXaOOM3S8J0owofy6L63tPMKNlQpTOnDBXaJIGIpfLVuv8e RPwFtQIUH3v7EOrCTGWLmLB0H7YbUEomLIfmYte8O6ZPx64QjusgkIxmiTn0/Veefq7M pGEt8yH0t/vwgIpSl+RtDysE0yr6nJS4JK3YSde04NTeyPjZmiEOJpHUKytYk9YebMaP ZBwTqRWOlcbPbyxbCtPg/99VSLhwlIy3blfpxEsFWPNLZqUxUrAIQcRPOOcELjbAp/DY UMb0QDSHWVMTyUFW5IIroZvxqvroUZ4aOu//kLYALqNBVGf71IaS4QGAehurQ0LEWc+H VK9Q== 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=gPDO3X5exveNuQB33sqGwYFDtLpn1MHpqh7qgx9Ds0U=; b=DhPoAzMktrMf6JbjlLjAdT3wM5xL+qcBV5oaZFsLHw4RcAmWmVIBG2bblLj1yRmost VUoH9SSXvkc71/JUmZUajwbDETYVBuak+rfMb5ZdNwTQrqrI28aN/SXQZaUsTmbmNOqv E3mENRYpT5f3800MXcMo4SJs7X2G/4YcbZej9QHFz8QRlWQF8QjaFULhbIYGbTjMn/IJ NPjPRB7D6sidNymUbImSbB1XZD7upyGtOq7O2u9gK3nyBAD+A2bKS20VtAAcpw8Sqifz ZQSDgrbtX6NjTIrGICRpulR04t3GO+8zW1bo17XG7M+xi//HMTbpsxDxr9khSCTXNOk4 SNZg== X-Gm-Message-State: AOAM5312LTKRuSgBFtEwzSvIkwmc/5aXku3xfC9kCJYTOWnVWhbljUIF XJ2V0maso9uBYyrLopML6eHT3g== X-Received: by 2002:a37:2dc4:: with SMTP id t187mr3763851qkh.166.1590414079640; Mon, 25 May 2020 06:41:19 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-156-34-48-30.dhcp-dynamic.fibreop.ns.bellaliant.net. [156.34.48.30]) by smtp.gmail.com with ESMTPSA id r15sm2718512qtt.42.2020.05.25.06.41.19 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 May 2020 06:41:19 -0700 (PDT) Received: from jgg by mlx.ziepe.ca with local (Exim 4.90_1) (envelope-from ) id 1jdDLy-0000hA-Jv; Mon, 25 May 2020 10:41:18 -0300 Date: Mon, 25 May 2020 10:41:18 -0300 From: Jason Gunthorpe To: Ralph Campbell Cc: nouveau@lists.freedesktop.org, linux-rdma@vger.kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, Jerome Glisse , John Hubbard , Christoph Hellwig , Ben Skeggs , Andrew Morton , Shuah Khan Subject: Re: [PATCH 0/6] nouveau/hmm: add support for mapping large pages Message-ID: <20200525134118.GA2536@ziepe.ca> References: <20200508192009.15302-1-rcampbell@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200508192009.15302-1-rcampbell@nvidia.com> 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 Fri, May 08, 2020 at 12:20:03PM -0700, Ralph Campbell wrote: > hmm_range_fault() returns an array of page frame numbers and flags for > how the pages are mapped in the requested process' page tables. The PFN > can be used to get the struct page with hmm_pfn_to_page() and the page size > order can be determined with compound_order(page) but if the page is larger > than order 0 (PAGE_SIZE), there is no indication that the page is mapped > using a larger page size. To be fully general, hmm_range_fault() would need > to return the mapping size to handle cases like a 1GB compound page being > mapped with 2MB PMD entries. However, the most common case is the mapping > size the same as the underlying compound page size. > This series adds a new output flag to indicate this so that callers know it > is safe to use a large device page table mapping if one is available. > Nouveau and the HMM tests are updated to use the new flag. > > Note that this series depends on a patch queued in Ben Skeggs' nouveau > tree ("nouveau/hmm: map pages after migration") and the patches queued > in Jason's HMM tree. > There is also a patch outstanding ("nouveau/hmm: fix nouveau_dmem_chunk > allocations") that is independent of the above and could be applied > before or after. Did Christoph and Matt's remarks get addressed here? I think ODP could use something like this, currently it checks every page to get back to the huge page size and this flag would optimze that Jason