Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1208613pxb; Fri, 1 Apr 2022 07:25:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwBmmbd1qatEGl4LmN4uiROOTveVra818f6nEQE1EIwylccDxIv5KbAcdScXCnzEAAYB+q X-Received: by 2002:a17:902:9889:b0:153:abee:fbc7 with SMTP id s9-20020a170902988900b00153abeefbc7mr10786464plp.117.1648823158097; Fri, 01 Apr 2022 07:25:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648823158; cv=none; d=google.com; s=arc-20160816; b=IX+YcXWfhUwT6mFmEn5KhsrSldBVRt184a1dkH7rjmwA0kyqLVHnWlsxZKS+3nCGn4 diwt0eAdl1Bb6qlzepb8DipF6fQRAYjfbUAbs5Fga/eyLaUFIDM4zKqmwLw+cn+qt8P9 YfwF11e7dud1yCOM649GsT9/VLrlaZVit/3F9Qhf8pn8rrTBPmUM53QSwteE2LJn+Bks pSD6psu/AtNJU84PLLFaoL5a5tJPj/MhvOdxJoERo0HaYUtu0t87YK2g2zWIshJ29NFX lr/ysPByxgYNcA4alpFoTgC4EM+mnvPGOdGcU1yN35daibdruEDtUPNjTKwlWw30sszL q6hg== 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=TsogI229fET+glT/fXjwEhCF5YIGcCFengKNeWhdntw=; b=e12MK5JyIvrh1hsfY7Os+x2ZDvOUlNcumt4WzW85kli78ZC0kNf7KjyGlVZ3B2CGFI Pg0SkcbX93hXt2uj8nUFLzIos51LDfE6sfYtkLsy5HEZs2Q2JmYcoA/afGZsYueotj0N IWJvcOCdeGEgo+By8Wa2+j2NzT6L1ujf67U+21SK9OS0bBS8asrixpv6oNdRl4Z85ddF w/LRWYrGvh+3nM7ahCzlQxc6ZsQcFOob+lTbK05C6svFa6OFl/TcKLXT9zamfGGbmw3P bp1+dD0nAySHKU0HlN5F1d9hE57ecQrVtigGq/wO/ej0QYeJNqxV854J93tolp/Esy/k VE3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=MRJ+IqR6; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s25-20020a634519000000b00382b764bfb3si2612765pga.381.2022.04.01.07.25.44; Fri, 01 Apr 2022 07:25:58 -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=@linuxfoundation.org header.s=korg header.b=MRJ+IqR6; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239295AbiDAGTg (ORCPT + 99 others); Fri, 1 Apr 2022 02:19:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235485AbiDAGTe (ORCPT ); Fri, 1 Apr 2022 02:19:34 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84AF51E6EB5 for ; Thu, 31 Mar 2022 23:17:45 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1B0F060BB5 for ; Fri, 1 Apr 2022 06:17:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2A73DC2BBE4; Fri, 1 Apr 2022 06:17:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1648793864; bh=8HJ2dThZuhlAG/zKt+3MnNMi7qOyxQ+9IpdZjNkR/lo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=MRJ+IqR6sNNK49lG+DQI4teQUGEdOP/AyEcFA7JW4CBs1h0S8V8NersUv1Z0hBF8u GR8o9y3awtwy6o3EozMKGc/PdiSC33dLBgNn4XEkoRcDwESnTaSGGH8m8wF8RDPQDh ABHoDqrBI9S2v8A+K9e4c1O5VtVG6DRgb4iynUsg= Date: Fri, 1 Apr 2022 08:17:41 +0200 From: Greg KH To: "Michael S. Tsirkin" Cc: Yao Hongbo , linux-kernel@vger.kernel.org, alikernel-developer@linux.alibaba.com Subject: Re: [PATCH] uio/uio_pci_generic: Introduce refcnt on open/release Message-ID: References: <1648692384-109967-1-git-send-email-yaohongbo@linux.alibaba.com> <20220331162521-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220331162521-mutt-send-email-mst@kernel.org> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,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 Thu, Mar 31, 2022 at 04:29:23PM -0400, Michael S. Tsirkin wrote: > On Thu, Mar 31, 2022 at 10:06:24AM +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. > > With two programs poking at the same device, how is this ever > supposed to work even while both are alive? > > > It's a common usage for spdk/dpdk to use UIO. > > Except people really should just use vfio ... Yes they should, the kernel should not care if multiple programs open the same UIO device node, it can not prevent that and userspace is on it's own here as it _should_ know what it is doing. thanks, greg k-h