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=-0.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 3C40FC47255 for ; Fri, 8 May 2020 19:59:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1C97B20CC7 for ; Fri, 8 May 2020 19:59:13 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="LO1NDtV4" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727772AbgEHT7M (ORCPT ); Fri, 8 May 2020 15:59:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43094 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726825AbgEHT7L (ORCPT ); Fri, 8 May 2020 15:59:11 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ECD7DC061A0C; Fri, 8 May 2020 12:59:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=gAppywnHh153AQRT3TEcx+if6lH9LfxxNVXC5Eam2gE=; b=LO1NDtV4fUL1HsosKlFp07Jetj ZmER83mcVniQHSmsmQkEliW+bBwKDjDgvgHLyNfoZZQSQ2d8d6uJ/E93YkCE/Pv2h22093IcHQJF/ CQ6TzUSGi2xhmQNj1rMfTNImRqt5Y+XlZHAUWdcvwdS3kCoksTLwVBiGa5dzHrkLrC81Z5Bsx81w+ vyMbYl3ABhhKu06mw/+kcUdRP4+2TYYCG7oCVYeSGa4gaBSaZTNDx7mUpGnSFcUEZZ5HfgBBuomDu MAZ3piEgZS2Htb32yXrt2sUDxPwPRqVjJHOn0ESp05K4R/E6t0rB+N92zScazXyjIB7muAAe5G5O9 K8Pn+buQ==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1jX99K-0004bs-6g; Fri, 08 May 2020 19:59:10 +0000 Date: Fri, 8 May 2020 12:59:10 -0700 From: Matthew Wilcox 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 , Jason Gunthorpe , Ben Skeggs , Andrew Morton , Shuah Khan Subject: Re: [PATCH 0/6] nouveau/hmm: add support for mapping large pages Message-ID: <20200508195910.GR16070@bombadil.infradead.org> 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> 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. This explanation doesn't make any sense. It doesn't matter how somebody else has it mapped; if it's a PMD-sized page, you can map it with a 2MB mapping.