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=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham 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 26D82C10F29 for ; Tue, 17 Mar 2020 07:34:59 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id CB919205ED for ; Tue, 17 Mar 2020 07:34:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CB919205ED Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 4EB566B0005; Tue, 17 Mar 2020 03:34:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 49BFB6B0006; Tue, 17 Mar 2020 03:34:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 3B1CE6B0007; Tue, 17 Mar 2020 03:34:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0184.hostedemail.com [216.40.44.184]) by kanga.kvack.org (Postfix) with ESMTP id 210C76B0005 for ; Tue, 17 Mar 2020 03:34:58 -0400 (EDT) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 18B085820 for ; Tue, 17 Mar 2020 07:34:58 +0000 (UTC) X-FDA: 76604042676.15.use00_4867deb91ed0c X-HE-Tag: use00_4867deb91ed0c X-Filterd-Recvd-Size: 2128 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by imf26.hostedemail.com (Postfix) with ESMTP for ; Tue, 17 Mar 2020 07:34:57 +0000 (UTC) Received: by verein.lst.de (Postfix, from userid 2407) id 46FA068BFE; Tue, 17 Mar 2020 08:34:54 +0100 (CET) Date: Tue, 17 Mar 2020 08:34:54 +0100 From: Christoph Hellwig To: Ralph Campbell Cc: Christoph Hellwig , Jason Gunthorpe , Dan Williams , Bharata B Rao , Christian =?iso-8859-1?Q?K=F6nig?= , Ben Skeggs , Jerome Glisse , kvm-ppc@vger.kernel.org, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-mm@kvack.org Subject: Re: [PATCH 3/4] mm: simplify device private page handling in hmm_range_fault Message-ID: <20200317073454.GA5843@lst.de> References: <20200316193216.920734-1-hch@lst.de> <20200316193216.920734-4-hch@lst.de> <7256f88d-809e-4aba-3c46-a223bd8cc521@nvidia.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7256f88d-809e-4aba-3c46-a223bd8cc521@nvidia.com> User-Agent: Mutt/1.5.17 (2007-11-01) 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 Mon, Mar 16, 2020 at 03:49:51PM -0700, Ralph Campbell wrote: > On 3/16/20 12:32 PM, Christoph Hellwig wrote: >> Remove the code to fault device private pages back into system memory >> that has never been used by any driver. Also replace the usage of the >> HMM_PFN_DEVICE_PRIVATE flag in the pfns array with a simple >> is_device_private_page check in nouveau. >> >> Signed-off-by: Christoph Hellwig > > Getting rid of HMM_PFN_DEVICE_PRIVATE seems reasonable to me since a driver can > look at the struct page but what if a driver needs to fault in a page from > another device's private memory? Should it call handle_mm_fault()? Obviously no driver cared for that so far. Once we have test cases for that and thus testable code we can add code to fault it in from hmm_vma_handle_pte.