Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp23937ybk; Fri, 8 May 2020 13:01:43 -0700 (PDT) X-Google-Smtp-Source: APiQypKvulWvffKRM0uo9A8BeRjoM9dvIB3L/L+Gh19FKlvORsGcDIjAk2R5+qAwwF7vXSXRMDEf X-Received: by 2002:a05:6402:88a:: with SMTP id e10mr3632817edy.252.1588968102995; Fri, 08 May 2020 13:01:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588968102; cv=none; d=google.com; s=arc-20160816; b=uwsSFkGfvw5J2c9KNP3BpQHan6PvO4GzfaSnc0HQu8luTjwBqLo150dum3tPplUVJs 3SY0Sy3+706lTGlL37MOFHLvK3b9WNAcVAoBa31AP6RmjZmifAubiGd8nYcERmNJPTMd mPMM1oaGxFRSq4HEFIaPLNRDymPCwYeYDimyJE7bHnNnpFfL6aEA/stdI4uaRF+ZbWfx VCbZk9+QS1MUvkI6JTzOQI0e+NOLzH75n9xl/NPtnba/Z+zGP2Q5QqSe5ntKBtlg0XEl I+zqXUg5/c5DEREAd8JMyE7sAGdTeNmHVBMGqQUhI8pp+ynLlYUVDHZW9u6tYhTREoW6 BAfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=gAppywnHh153AQRT3TEcx+if6lH9LfxxNVXC5Eam2gE=; b=yS5pMXyIXBkV0j5RUYBvMjDVj2zNET9EzIDz8j3CIvL8D6soDVeCypu66tEcOSWJOu t4A7VSvmSKjhJE6Xp7WzD/tOEK9GhKado+AhBVktAX31/mPBLNUS5BGDsg1AtZ2mrGXO zf8upRe72y+EelgAhrGU4kDR3mvmIgy1yfGPfOwsKh346tsKejaCStKwjge3Gz3jS5EK gKkpmjjamcZ6jPPamMtsVUQ3E2sgq87/NwR8H22UJFe+LOZcWFlCxXsv8n4qX4kAcJBH MqV9ZWPQthmv1baMm2VlMrxGkpYvHEB3XRckGtOXJxHmeeOtYUUUWZQV1vNrMNhjamH0 L7vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=LO1NDtV4; 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 r24si1538375edm.269.2020.05.08.13.00.48; Fri, 08 May 2020 13:01:42 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=LO1NDtV4; 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 S1727119AbgEHT7M (ORCPT + 99 others); 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.