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=-2.4 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 F392FC433E0 for ; Mon, 25 May 2020 13:41:21 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AC2C52073B for ; Mon, 25 May 2020 13:41:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="YWisdnil" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AC2C52073B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 39FB280036; Mon, 25 May 2020 09:41:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 328BE8E0008; Mon, 25 May 2020 09:41:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1F03E80036; Mon, 25 May 2020 09:41:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0094.hostedemail.com [216.40.44.94]) by kanga.kvack.org (Postfix) with ESMTP id 044518E0008 for ; Mon, 25 May 2020 09:41:20 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id B3BD28245571 for ; Mon, 25 May 2020 13:41:20 +0000 (UTC) X-FDA: 76855353120.22.net17_bb1d18a5d842 X-HE-Tag: net17_bb1d18a5d842 X-Filterd-Recvd-Size: 4938 Received: from mail-qk1-f194.google.com (mail-qk1-f194.google.com [209.85.222.194]) by imf35.hostedemail.com (Postfix) with ESMTP for ; Mon, 25 May 2020 13:41:20 +0000 (UTC) Received: by mail-qk1-f194.google.com with SMTP id z80so17528162qka.0 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=j8SdZCe3DgMJ0AyA35WriK4wgCou/DilywcJu9wK570mPivCfJwvEJGLqhn/bpSymx wGj5AUXICk/zTCaeypiOmC+7zDyiibuoKbUhWzip7WGeolAQDX7sa7mVPq2qsp8X3tnv Qvd262ubbyj9PunoRYCQIj7bJyecpDlBcOmeng6d862JWzZ+t2oEDGsc9GUStm3Ihjft h3Cc4vmAueXf00ELmo+NEOSM3DDTPkj0KpaE/seYisTImwsDHLMRiQ+J443HVk+CQ1Xi rdBhn/PPOCgkQWd5Vnl5sKmQQv975ho5tz1JDJ195AQiuNG1ZvYYhdkT2K71vpzPVCps E+JQ== X-Gm-Message-State: AOAM530rucG816pe7fJEG+1p4YCueuR3jPMiyeHwgFzoceUssjxTSR4W fsYxUf4mYm7oykvlA0L6eL6rlw== X-Google-Smtp-Source: ABdhPJztwwj2Lmnes/knDFhWm/x9ekYq2TGHNL3KtgNw4hZnEPBap7aZFzv7gZ3WmAGU8iH6kzNbLg== 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) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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