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.3 required=3.0 tests=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 A6172C18E5B for ; Tue, 17 Mar 2020 12:24:50 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 56CF7206EC for ; Tue, 17 Mar 2020 12:24:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 56CF7206EC 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 D3A026B0005; Tue, 17 Mar 2020 08:24:49 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CEA666B0006; Tue, 17 Mar 2020 08:24:49 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BFEE76B0007; Tue, 17 Mar 2020 08:24:49 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0026.hostedemail.com [216.40.44.26]) by kanga.kvack.org (Postfix) with ESMTP id A54DA6B0005 for ; Tue, 17 Mar 2020 08:24:49 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 60E5A5DD6 for ; Tue, 17 Mar 2020 12:24:49 +0000 (UTC) X-FDA: 76604773098.30.worm35_815a472734119 X-HE-Tag: worm35_815a472734119 X-Filterd-Recvd-Size: 2195 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by imf09.hostedemail.com (Postfix) with ESMTP for ; Tue, 17 Mar 2020 12:24:48 +0000 (UTC) Received: by verein.lst.de (Postfix, from userid 2407) id 837AF68BFE; Tue, 17 Mar 2020 13:24:45 +0100 (CET) Date: Tue, 17 Mar 2020 13:24:45 +0100 From: Christoph Hellwig To: Jason Gunthorpe Cc: Ralph Campbell , Christoph Hellwig , 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: <20200317122445.GA11662@lst.de> References: <20200316193216.920734-1-hch@lst.de> <20200316193216.920734-4-hch@lst.de> <7256f88d-809e-4aba-3c46-a223bd8cc521@nvidia.com> <20200317121536.GQ20941@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200317121536.GQ20941@ziepe.ca> 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 Tue, Mar 17, 2020 at 09:15:36AM -0300, Jason Gunthorpe wrote: > > 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()? > > Isn't that what this series basically does? > > The dev_private_owner is set to the type of pgmap the device knows how > to handle, and everything else is automatically faulted for the > device. > > If the device does not know how to handle device_private then it sets > dev_private_owner to NULL and it never gets device_private pfns. > > Since the device_private pfn cannot be dma mapped, drivers must have > explicit support for them. No, with this series (and all actual callers before this series) we never fault in device private pages. 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.3 required=3.0 tests=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 D716DC2BB1D for ; Tue, 17 Mar 2020 13:50:16 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B732120757 for ; Tue, 17 Mar 2020 13:50:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B732120757 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=amd-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 372856E147; Tue, 17 Mar 2020 13:50:09 +0000 (UTC) Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0D58E89EAE; Tue, 17 Mar 2020 12:24:48 +0000 (UTC) Received: by verein.lst.de (Postfix, from userid 2407) id 837AF68BFE; Tue, 17 Mar 2020 13:24:45 +0100 (CET) Date: Tue, 17 Mar 2020 13:24:45 +0100 From: Christoph Hellwig To: Jason Gunthorpe Subject: Re: [PATCH 3/4] mm: simplify device private page handling in hmm_range_fault Message-ID: <20200317122445.GA11662@lst.de> References: <20200316193216.920734-1-hch@lst.de> <20200316193216.920734-4-hch@lst.de> <7256f88d-809e-4aba-3c46-a223bd8cc521@nvidia.com> <20200317121536.GQ20941@ziepe.ca> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200317121536.GQ20941@ziepe.ca> User-Agent: Mutt/1.5.17 (2007-11-01) X-Mailman-Approved-At: Tue, 17 Mar 2020 13:50:08 +0000 X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Ralph Campbell , amd-gfx@lists.freedesktop.org, nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, kvm-ppc@vger.kernel.org, Christoph Hellwig , linux-mm@kvack.org, Jerome Glisse , Ben Skeggs , Dan Williams , Bharata B Rao , Christian =?iso-8859-1?Q?K=F6nig?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" On Tue, Mar 17, 2020 at 09:15:36AM -0300, Jason Gunthorpe wrote: > > 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()? > > Isn't that what this series basically does? > > The dev_private_owner is set to the type of pgmap the device knows how > to handle, and everything else is automatically faulted for the > device. > > If the device does not know how to handle device_private then it sets > dev_private_owner to NULL and it never gets device_private pfns. > > Since the device_private pfn cannot be dma mapped, drivers must have > explicit support for them. No, with this series (and all actual callers before this series) we never fault in device private pages. _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christoph Hellwig Date: Tue, 17 Mar 2020 12:24:45 +0000 Subject: Re: [PATCH 3/4] mm: simplify device private page handling in hmm_range_fault Message-Id: <20200317122445.GA11662@lst.de> List-Id: References: <20200316193216.920734-1-hch@lst.de> <20200316193216.920734-4-hch@lst.de> <7256f88d-809e-4aba-3c46-a223bd8cc521@nvidia.com> <20200317121536.GQ20941@ziepe.ca> In-Reply-To: <20200317121536.GQ20941@ziepe.ca> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Jason Gunthorpe Cc: Ralph Campbell , Christoph Hellwig , 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 On Tue, Mar 17, 2020 at 09:15:36AM -0300, Jason Gunthorpe wrote: > > 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()? > > Isn't that what this series basically does? > > The dev_private_owner is set to the type of pgmap the device knows how > to handle, and everything else is automatically faulted for the > device. > > If the device does not know how to handle device_private then it sets > dev_private_owner to NULL and it never gets device_private pfns. > > Since the device_private pfn cannot be dma mapped, drivers must have > explicit support for them. No, with this series (and all actual callers before this series) we never fault in device private pages.