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 D2D9DC43334 for ; Wed, 29 Jun 2022 06:49:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 58BCD8E0006; Wed, 29 Jun 2022 02:49:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 538E48E0002; Wed, 29 Jun 2022 02:49:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 427888E0006; Wed, 29 Jun 2022 02:49:00 -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 3134B8E0002 for ; Wed, 29 Jun 2022 02:49:00 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id 07B94121175 for ; Wed, 29 Jun 2022 06:49:00 +0000 (UTC) X-FDA: 79630346040.05.953DEC1 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by imf30.hostedemail.com (Postfix) with ESMTP id 9B05D80020 for ; Wed, 29 Jun 2022 06:48:59 +0000 (UTC) Received: by verein.lst.de (Postfix, from userid 2407) id D89A267373; Wed, 29 Jun 2022 08:48:54 +0200 (CEST) Date: Wed, 29 Jun 2022 08:48:54 +0200 From: Christoph Hellwig To: Logan Gunthorpe Cc: 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 , Christoph Hellwig , Dan Williams , Jason Gunthorpe , 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: <20220629064854.GD17576@lst.de> References: <20220615161233.17527-1-logang@deltatee.com> <20220615161233.17527-21-logang@deltatee.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220615161233.17527-21-logang@deltatee.com> User-Agent: Mutt/1.5.17 (2007-11-01) ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656485339; a=rsa-sha256; cv=none; b=18Qs9R5buPc8pz2RwHwx/1tx3Wm6wzAswVTJFYnAxuPRkEWyUA4ts04qSCFhYYivg6WV0r aTQkY45wLaA+iLQQIe80zxdql1w0G9LeUYD8RDTIHkP23jHDfvGiJNh8sclY1hdozeCdvk wmshzfXsJauLtTgfO7SK+2jzgd1jAxI= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=none; spf=none (imf30.hostedemail.com: domain of hch@lst.de has no SPF policy when checking 213.95.11.211) smtp.mailfrom=hch@lst.de; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656485339; 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=lN/MIYjKW9MZMK0inIUxxF3vHxyHrlf3M+uqEEBMv4s=; b=bdptI1j3RByZKZv6QFUbVA+yiUD+ye8r6HT4z4KdMpQKYndKZDHQZ7FezgojPVqqsObmIN NPxmU3BPYOtMuKCjj67m4nk2KUarg7029Gd3BM9ID5W2g+XicFO88Dn17y2OSDY3niYGwQ 6FhE6tRwCSYpAK78qa5gf+X7q9PtdSc= X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 9B05D80020 X-Rspam-User: X-Stat-Signature: jq1uofzht8nnhd3tdfgr8fk3b8dum8r3 Authentication-Results: imf30.hostedemail.com; dkim=none; spf=none (imf30.hostedemail.com: domain of hch@lst.de has no SPF policy when checking 213.95.11.211) smtp.mailfrom=hch@lst.de; dmarc=none X-HE-Tag: 1656485339-226101 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 Wed, Jun 15, 2022 at 10:12:32AM -0600, Logan Gunthorpe wrote: > A pseudo mount is used to allocate an inode for each PCI device. The > inode's address_space is used in the file doing the mmap so that all > VMAs are collected and can be unmapped if the PCI device is unbound. > After unmapping, the VMAs are iterated through and their pages are > put so the device can continue to be unbound. An active flag is used > to signal to VMAs not to allocate any further P2P memory once the > removal process starts. The flag is synchronized with concurrent > access with an RCU lock. Can't we come up with a way of doing this without all the pseudo-fs garbagage? I really hate all the overhead for that in the next nvme patch as well.