Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp7327340ioo; Fri, 3 Jun 2022 04:33:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfMihgk+ePqPhEhgsLSx5YxnB7B1nnPtaKflNusmCnaiiIt7FpVQpdxIfnXo7QIPMl8OZg X-Received: by 2002:a17:907:7f9f:b0:6ff:4275:1e4e with SMTP id qk31-20020a1709077f9f00b006ff42751e4emr8012782ejc.121.1654256009174; Fri, 03 Jun 2022 04:33:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654256009; cv=none; d=google.com; s=arc-20160816; b=SkR/7rBYBnty9C0xe1l6jDtBFjd3Pp/aKF3fAZRrMy+ltXshM3FWHJ//1dauPKmANJ qcCucrm7EnwbOaqC+J+zOimMkcxoVumBZCEiqIdx9YOQJvc6uq63TUDRnPnE/OX8Fe0b XrtKBcYGS92wbtqcD5/2SWnC8ZX2biMG5c6oJSi0LEwe3FmFX3d5bIb9+xyvcun6OYNl HbXj4D3gxv+Z3vQusj6oLFMMr1L9FSC+zad5ixHv4AEUWpTVBA0eBzZdA6FPDYxyfDdk J2xQJEElr+GTcJTtPZxDD5hH4PNmybU+kGaYk++hYKFdkvMOfkr/pSqvtSFPOjruaJft y2Gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=k8kPkxVeNMtdQt55yGN/Nkf+fdNFP4n1eqHNYFzt/EM=; b=Y4CXFDBUgsGx68OsSAuPPSLMUxakltvTvvQIyqF2sCgMM3p5AdvORp34Polftkr5xT KlczABv75ag9vNYAX74jx3WLUsHsoUsPNkPc97Lxp9VrYPOqAFxYkTILwBQbONFqIyu8 e5xxPMRAfa7F6pdPsRNHeRBepYXcs5YzdGFlIFE5KPS5ipztmGRJwGu5jtahVD+Y/NEJ d9r6aSy3EHH5OILVJ4AdEgYJiLxb1jqBrwWMzLb/H+nw0mBoqZ9M/cUcA2Tj4fJk+Bmf Z99wcXZF+XzhpVjkSvUUuOwVFkcCPzHp4Vr+nm89MFmbOJm6Kk5L4fkWzcFOCyCBtuHk b4lw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ziepe.ca header.s=google header.b=RBKGIdGV; 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 c9-20020a17090603c900b006ff237fad16si8119140eja.519.2022.06.03.04.33.02; Fri, 03 Jun 2022 04:33:29 -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; dkim=pass header.i=@ziepe.ca header.s=google header.b=RBKGIdGV; 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 S237058AbiFBQbP (ORCPT + 99 others); Thu, 2 Jun 2022 12:31:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53118 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237057AbiFBQbI (ORCPT ); Thu, 2 Jun 2022 12:31:08 -0400 Received: from mail-qt1-x829.google.com (mail-qt1-x829.google.com [IPv6:2607:f8b0:4864:20::829]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9EF812B12C6 for ; Thu, 2 Jun 2022 09:31:01 -0700 (PDT) Received: by mail-qt1-x829.google.com with SMTP id x7so3739870qta.6 for ; Thu, 02 Jun 2022 09:31:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=k8kPkxVeNMtdQt55yGN/Nkf+fdNFP4n1eqHNYFzt/EM=; b=RBKGIdGVGyENiynuzvWzxsfKrlShOYG7LDNM6zk7j/0cpFAWM0CNoQ/RikC676Zwip BMHOMh5FSPCGjY61J1z6G+8c1X+4G/XGBmJ3fum6tDtClMi6od+zOdkcyAAKXb0oiOit b12jjL7nGu0mjk8vwPx18er2whDmGOBIM4slv0jp+xyv6iWVZkV8Hkprx2Ft3TnlNr8S F3ZKnuaS0udbsMCk0y55d04otKL6PRXBEyvPN62xIots/ndr10XIEf2q5FJvYZj2hwlD Ppp12ccOTvvIFXm+WxGW6jlLIOBk5xmPC4ktWEJBo/O94h/wW5jv5ZkhHpnGnc8M8pyV u4zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=k8kPkxVeNMtdQt55yGN/Nkf+fdNFP4n1eqHNYFzt/EM=; b=2w4hkTfWEqvtnH7S0gmjkgQBEjQLycvkj8AGxxeibc1kEH0xhOZSlQ4Io8n2xoh6i7 NpMAppCN5/Cf1nLwMdQbtmAydjmyilghm238HEOW9HBE5RAHG+x+PB6M79tu9mgGjv5j 0tuRIb38fqD0+WMq0k8XXyjkdGgiH7kl1irI9l9GuVykwoSai5C1TxvNIIcwkRWj82wM yarh7LIL50AHJ1NgsU7D/ln/Rcg7C/hEAoCG4diQHpOTlHx6CXS5+flwR91ePoYfePaJ 58A97dmgECWiZU7LyiTEIUvzrc01SIEIS8OddKdV6GjtGr6Cdezk4/EdEHP1OZRoyBNm x9FQ== X-Gm-Message-State: AOAM530IF+j1UOCaEo/0CHHluvLoTFb616sS1XScTHq/J5A/013Ybppb kJ8rH24c7qz05RHapBcpAU2PZpWJJXuHrw== X-Received: by 2002:ac8:5e49:0:b0:304:c7db:6a2f with SMTP id i9-20020ac85e49000000b00304c7db6a2fmr4316676qtx.274.1654187460731; Thu, 02 Jun 2022 09:31:00 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-142-162-113-129.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.162.113.129]) by smtp.gmail.com with ESMTPSA id ci11-20020a05622a260b00b00304bc2acc25sm3261689qtb.6.2022.06.02.09.30.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jun 2022 09:30:59 -0700 (PDT) Received: from jgg by mlx with local (Exim 4.94) (envelope-from ) id 1nwnit-00GTLv-7Y; Thu, 02 Jun 2022 13:30:59 -0300 Date: Thu, 2 Jun 2022 13:30:59 -0300 From: Jason Gunthorpe 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 , Christian =?utf-8?B?S8O2bmln?= , John Hubbard , Don Dutile , Matthew Wilcox , Daniel Vetter , Jakowski Andrzej , 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 v6 20/21] PCI/P2PDMA: Introduce pci_mmap_p2pmem() Message-ID: <20220602163059.GL2960187@ziepe.ca> References: <20220407154717.7695-1-logang@deltatee.com> <20220407154717.7695-21-logang@deltatee.com> <20220527125501.GD2960187@ziepe.ca> <20220527190307.GG2960187@ziepe.ca> <20220602000038.GK2960187@ziepe.ca> <400baba7-1cd6-09d4-4de9-2a73f08afc79@deltatee.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <400baba7-1cd6-09d4-4de9-2a73f08afc79@deltatee.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Thu, Jun 02, 2022 at 10:16:10AM -0600, Logan Gunthorpe wrote: > > Just stuff the pages into the mmap, and your driver unprobe will > > automatically block until all the mmaps are closed - no different than > > having an open file descriptor or something. > > Oh is that what we want? Yes, it is the typical case - eg if you have a sysfs file open unbind hangs indefinitely. Many drivers can't unbind while they have open file descriptors/etc. A couple drivers go out of their way to allow unbinding while a live userspace exists but this can get complicated. Usually there should be a good reason. The module will already be refcounted anyhow because the mmap points to a char file which holds a module reference - meaning a simple rmmod of the driver shouldn't work already.. Jason