Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp984348pxb; Fri, 15 Apr 2022 17:24:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyKB44eXJOfe6ftA1/+0VqB5F9qiP6V1hR2zlGmPFXBAFfy0AooI8tjEgyiW+06Sa5hKNN8 X-Received: by 2002:a05:6a00:2887:b0:509:6909:6de0 with SMTP id ch7-20020a056a00288700b0050969096de0mr1538627pfb.22.1650068690757; Fri, 15 Apr 2022 17:24:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650068690; cv=none; d=google.com; s=arc-20160816; b=z97erSlvHSx6S0qpKtuBuAYqQpExliGLPuIfc+3yukJG7Mb6ONM/83Xjw/7y9YJFsw hkqYaWH612PdXHDQxJg+WXvt3dP2mRgvk9yf7VElXHe8j5/D+dvtUnG8be0GfALx6rr7 298iX2AKcVABdrlQPxCk3wtCw1w1qnfXt5ZPRaHaqkCg7x2swQMcNsA0dPJo0+1rO3Ar b51+mwj+pgeXxqZxQY0EQIxrAPrQUTAk162riPvJaK61503dQFfS5g8bhcmLjh/MN6bc JYTjr0tOZj290ilPoc5/WnZHerMzuczgyMydDcEwv24jKOepWYJE4lwF7AC7fLlg87zk 7A+g== 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=a15IgzCBGiGWJfnLVtPP4LMnUkGHMDur6ILlVeSBkm4=; b=iOhieUTbczG6Gf2z+AwLiaZKBjx0o63rXnoWaKmodhfObVAwRHK2py+iuKmrM01fTH lrEbrvV/5qabN3wob1GqpOzA2lYTxojJSTV0kM8lk1uUmzJqJd03w4xJvGHL0yEFK4dM hqDlR7432yy+L5VLT+RaueY9QSWmFY/R47fKlGTsJanI3ufMmjxjsTrrc7Rmb2AZDHwh N8tVLh2Z9nQdWxHaOMo4CkxZiMRxe73iw0Tv/WbsGV6yhF2Ks3JwjsR24QVALqEuSPzt ZyZEGBYhPc9JMRR2+jOH7gdpnrF4UQ86tf1E5yXGsW+IDa7DaEfBsV0lLMSxjbJ3SDnn nFNg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=sdup4Spt; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id p3-20020a63ab03000000b003816043ef73si2928597pgf.360.2022.04.15.17.24.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Apr 2022 17:24:50 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=sdup4Spt; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0A8C0D64F8; Fri, 15 Apr 2022 17:23:32 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344838AbiDOGtz (ORCPT + 99 others); Fri, 15 Apr 2022 02:49:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350823AbiDOGtv (ORCPT ); Fri, 15 Apr 2022 02:49:51 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 98E7CB18A0; Thu, 14 Apr 2022 23:47:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=a15IgzCBGiGWJfnLVtPP4LMnUkGHMDur6ILlVeSBkm4=; b=sdup4SptYer8etuY8zgqpPEfcY 2wntqId5LyhW+g4ZpPEq9D1NXaBHbczKAvhXIVi6qny3bJ9mRkLYjJ4cj8JuFHi+XFuFAWPCzUsgt TUpTUMgU92EPp5/576dw+GYIiAEv21tLLV5BSFKkOnrNhixb+h2Ggvs68E6A8a4ueX0ZPsG+tKTlk IFQiUvJEGE556iWK7CKkgRLIpMryA/bI/RwxUGqTOtARmFqRPYCNUfiQ/muApdZ0++MU/EpMidMwz PQl56t7IrVLtAd60EK9vrH1OBAnu7Qd8uu8w3ff6o08amsV+PK8HT9eLqJRmChsVwepFuIYeNumA9 SOpqjcEA==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nfFje-0096Oz-19; Fri, 15 Apr 2022 06:47:14 +0000 Date: Thu, 14 Apr 2022 23:47:14 -0700 From: Christoph Hellwig To: Greg KH Cc: Yao Hongbo , mst@redhat.com, alikernel-developer@linux.alibaba.com, kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] uio/uio_pci_generic: Introduce refcnt on open/release Message-ID: References: <1649833302-27299-1-git-send-email-yaohongbo@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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, Apr 13, 2022 at 09:33:17AM +0200, Greg KH wrote: > On Wed, Apr 13, 2022 at 03:01:42PM +0800, Yao Hongbo wrote: > > If two userspace programs both open the PCI UIO fd, when one > > of the program exits uncleanly, the other will cause IO hang > > due to bus-mastering disabled. > > > > It's a common usage for spdk/dpdk to use UIO. So, introduce refcnt > > to avoid such problems. > > Why do you have multiple userspace programs opening the same device? > Shouldn't they coordinate? Independent of that (very valid) question I think the current code is just broken. Either we need to prohbit multiple opens or do this kind of refcounting.