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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id BC32EC43334 for ; Tue, 5 Jul 2022 16:43:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 419A76B0073; Tue, 5 Jul 2022 12:43:19 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3C9786B0074; Tue, 5 Jul 2022 12:43:19 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2B8A38E0001; Tue, 5 Jul 2022 12:43:19 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 1D4EE6B0073 for ; Tue, 5 Jul 2022 12:43:19 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id F327C120955 for ; Tue, 5 Jul 2022 16:43:18 +0000 (UTC) X-FDA: 79653616476.01.981EDAF Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by imf03.hostedemail.com (Postfix) with ESMTP id 89F612000C for ; Tue, 5 Jul 2022 16:43:18 +0000 (UTC) Received: by verein.lst.de (Postfix, from userid 2407) id 31F3168AA6; Tue, 5 Jul 2022 18:43:15 +0200 (CEST) Date: Tue, 5 Jul 2022 18:43:15 +0200 From: Christoph Hellwig To: Logan Gunthorpe Cc: Christoph Hellwig , Jason Gunthorpe , linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org, linux-block@vger.kernel.org, linux-pci@vger.kernel.org, linux-mm@kvack.org, iommu@lists.linux-foundation.org, Stephen Bates , Dan Williams , Christian =?iso-8859-1?Q?K=F6nig?= , John Hubbard , Don Dutile , Matthew Wilcox , Daniel Vetter , Minturn Dave B , Jason Ekstrand , Dave Hansen , Xiong Jianxin , Bjorn Helgaas , Ira Weiny , Robin Murphy , Martin Oliveira , Chaitanya Kulkarni , Ralph Campbell , Bjorn Helgaas Subject: Re: [PATCH v7 20/21] PCI/P2PDMA: Introduce pci_mmap_p2pmem() Message-ID: <20220705164315.GB14484@lst.de> References: <20220615161233.17527-1-logang@deltatee.com> <20220615161233.17527-21-logang@deltatee.com> <20220629064854.GD17576@lst.de> <99242789-66a6-bbd2-b56a-e47891f4522e@deltatee.com> <20220629175906.GU23621@ziepe.ca> <20220705075108.GB17451@lst.de> <20220705135102.GE23621@ziepe.ca> <20220705161240.GB13721@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1657039398; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7NxEUOhBA/vpCLtgBoaHFhHtEAgPzmWy1pdQgH0j92E=; b=dP9/R+sViFsxUT1dRUdwpSYJtoCleoaZzgd0a98crnD7belzX7seDIV/ZYZ2AuKIBTJrfS 3JSxOOGkpw9bdWPMRKCBJQkcIp1vZUp9oG+k0yXspelPJXBj+hakZ0/xxds+gshwjkiONC 2abXEoVNY9F5hg07TleaMHiOGnV7fbo= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1657039398; a=rsa-sha256; cv=none; b=DPKboTl+BfrzzQOCmznvI0Q0f9i7OfnPQ3rsA7CQ2k+k+GjforhrowH1w4O5grTACARvrG F8XwCY83ySwJSjLmN+2ss1Efz3y34k15rRjGbanejNN48b/r2w/SWLXpQhXWwZFL9wNET9 j3N0W2p9YJFU7m3blQx4d7F29Ph5baQ= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=none; dmarc=none; spf=none (imf03.hostedemail.com: domain of hch@lst.de has no SPF policy when checking 213.95.11.211) smtp.mailfrom=hch@lst.de X-Stat-Signature: 3ywbj9jbfs657duj9ecycbyqe1ed6gzg X-Rspamd-Queue-Id: 89F612000C X-Rspam-User: Authentication-Results: imf03.hostedemail.com; dkim=none; dmarc=none; spf=none (imf03.hostedemail.com: domain of hch@lst.de has no SPF policy when checking 213.95.11.211) smtp.mailfrom=hch@lst.de X-Rspamd-Server: rspam06 X-HE-Tag: 1657039398-146745 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, Jul 05, 2022 at 10:41:52AM -0600, Logan Gunthorpe wrote: > Using sysfs means we don't need all the messy callbacks from the nvme > driver, which is a plus. But I'm not sure how we'd get or unmap the > mapping of a sysfs file or avoid the anonymous inode. Seems with the > existing PCI resources, it uses an bin_attribute->f_mapping() callback > to pass back the iomem_get_mapping() mapping on file open. > revoke_iomem() is then used to nuke the VMAs. I don't think we can use > the same infrastructure here as that would add a dependency on > CONFIG_IO_STRICT_DEVMEM; which would be odd. And I'm not sure whether > there is a better way. Why can't we do the revoke on the actual sysfs inode?