Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp305136iog; Tue, 28 Jun 2022 23:59:39 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s0Nfsrtpn9bUr49vH4nAkNIhPE+uJRdQ1AVzyq4LoCUIxH/g/mIPpTRFOJ3TmYWhFEoXNO X-Received: by 2002:a17:906:11d:b0:712:abf:3210 with SMTP id 29-20020a170906011d00b007120abf3210mr1786423eje.292.1656485979401; Tue, 28 Jun 2022 23:59:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656485979; cv=none; d=google.com; s=arc-20160816; b=oarBb688blehZZrf3SYbshAaYxulq4B9BZCfYfvmHyMuQB+s8lj0AI9Xq8eq41/vcZ E/7Dt+X6GvcvTW5CFY/Da55FNwmZx1lKKqyF58d9tLscccmGErA0Th19ggOT0HlDU2Sl DoLFDsWn4a+UPL9mV/+nJ+nNKFFDyOw2mfFqQBGxbbtsWtb3fM6l91rC6deZ+WEoT/ns ZcGgNZIFvorSwc+iLkBIeuEHDfVBLAbyMFbC/4aqYE4eC9MfaCSPPaUj0fgCep58S7EO SkPSS1+QyzaTeAlOprRB2gntixJVRhlZ+D972yB56wcCiR7iYpsIIHuEA+jBqB0z5oWH PCyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=lN/MIYjKW9MZMK0inIUxxF3vHxyHrlf3M+uqEEBMv4s=; b=eKl/73M+CMTTpiZUVlBjIL9AYpHcQqxp6FRXb4z98P7TW6Hxpr2OU6F2eumWCI+h4l XNO2hRsw7EGoLKRp0sqxOcHHiUeA3v2Lo94Jsb5yICaAcIcPXmZ/1soRC/1L30ITs2eX pOKUBi07STIOAA6N1K/9CaHxqhFckt5Ksj0xvsbKb7NwK3V1szU1QqZcI9b8h6KPrAi8 hyi7f71ZyaYk3aUBCsU+npO0XLo2KJLjiJSg7cYzqfnx/48BUwXD4WP+K4fEIR6YWW96 /WhekktFov613kAFOy6hiAk1SGIjCexyePECMo17YTlnXSryjS0n3vAo9gZF960Vv6PU Oghw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o12-20020a170906974c00b0070790bfa9a2si1402502ejy.154.2022.06.28.23.59.13; Tue, 28 Jun 2022 23:59:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232362AbiF2GtF (ORCPT + 99 others); Wed, 29 Jun 2022 02:49:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232356AbiF2GtA (ORCPT ); Wed, 29 Jun 2022 02:49:00 -0400 Received: from verein.lst.de (verein.lst.de [213.95.11.211]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55C782FE76; Tue, 28 Jun 2022 23:49:00 -0700 (PDT) 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) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.