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 gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 12EEDE6BF0F for ; Fri, 30 Jan 2026 13:56:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7384110E100; Fri, 30 Jan 2026 13:56:22 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; secure) header.d=ziepe.ca header.i=@ziepe.ca header.b="Z8deGvD3"; dkim-atps=neutral Received: from mail-qv1-f46.google.com (mail-qv1-f46.google.com [209.85.219.46]) by gabe.freedesktop.org (Postfix) with ESMTPS id C6E1C10E11C for ; Fri, 30 Jan 2026 13:56:20 +0000 (UTC) Received: by mail-qv1-f46.google.com with SMTP id 6a1803df08f44-894774491deso28387286d6.2 for ; Fri, 30 Jan 2026 05:56:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1769781379; x=1770386179; darn=lists.freedesktop.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=nHaCd4HrbYw78ScpRIoaj6AeaBJaVtnx8urFDLScj1Y=; b=Z8deGvD3MtWtmdYm4TJCnWvkKNM3+syMTy4LW3kivOuC6AARMfvNm9DAkVbu0iM/Xt xgKOWKatpqV6Yp6usrQAJnM2nHGu6NKWGJkHXUbAch1qQls/fuo3f+UXLsmZD8Tz4NW7 FvI5mb45CpOdYnqTZ3T3nGvXeit8Zbo6Z04C/DpTvNbMksjDEnTYLBljgYcpCk3dSWtn efjLiLkMULvwmSk+7xUFGArERe/8pTQxFAmRsqC3aCbRAO8SRGR5cs16CLoD3lTbvHN3 9Ltr1hVT3ESfFITI9AjPLIMdSS24LsjA5GxOCHa2V7yItDjPsdl5IAb4W5QYoqAosQx8 ZsJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1769781379; x=1770386179; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=nHaCd4HrbYw78ScpRIoaj6AeaBJaVtnx8urFDLScj1Y=; b=qul8hBJzJX59TVersMLNBhbiKuIg4ckBvdLD6j+6vj5vUUWTASlcx2uqM7tNTUGHyn c1dWIXSXP4zn0I2wepE94IgbQUlDLpeqN+23hqv+WKWXCaR8DoiGTtmHp8vVndhi3I16 RKwWeGLohyTMFwK8Qsxk5N9+1cmJPq/JvylW+CeQ1/PIEQOZdXdKarVAUnaQCiH5iiBN q1aYCFDQHQhV9JgdBFp7alg/fd+iJHZqMVLLaRY8XSyOg8jVkozCNvqFcH+NJrmJt+Aj 2LGV6X6TdWktdaeUapCk4whVT7Kat2JRqGznQaiNR4pmj6Ck0iXLMeGs8fVUiyGNpf0J VXFg== X-Forwarded-Encrypted: i=1; AJvYcCUIhVQjIIfZPfBXmt1iev9lBzvS68+GAl8Jd27eNV78i/ZqM6nofcXjDZWWeTXoVpwigHhx4JpQFdo=@lists.freedesktop.org X-Gm-Message-State: AOJu0YzlAFXiK1jSza4xWibkbQpFmhXndBRIlmfQxoIdkJtPI/sctfey rhAn7LOsBDMnIHrzDtM/7O5ebw8W71i7mHu0ojAHhkA62iZYFPRhdS9LxLaMByfbUCo= X-Gm-Gg: AZuq6aKbb7nGx1vMyoTWmuWTowW+2o3wE1wQVeOOwYAkCpod/6NBY6zcB9MStJUCwkp 6GZWuQ4ZVSJnS3H4nhxwvU9nfQrvoZtWxnxK1dh0J0f92xtevIhPFpGX2a9d3/+RC5iTpsUWQmQ RPkqJdLbN/bqvAYbh7s9muZjan/kwDzCMP/wN74lwy5KT5So7+k4uR76XxgSUny86qRpxsdm0f1 xNJdKRB/j0rMDp0OWNysauAoikbV3+5l6J0q540mfnknXx6eZnYGSM/HSedrduTbKBvFddk/MDw nb4R45Fd7w/W7zLXeNyX80sWsG6zUYwrH7T5Nb/W3at+NP36fwcNCdxZkxP/hxFZxX4pUewaLHa c019PTh7aHIQZ7ZFp13ZskTgzCDB2cceLknfcKIrJz7jrZH96zDhfppipNzR+Sfs0J/T9YCD2eC lUKAwAnbrsOYzOA5gcWFlC+YqHNsb/aZn5uE+H2RxKBfAgGn2Fxo9DULCH1t7gtILK3DVaF9/U8 j9j3A== X-Received: by 2002:a05:6214:2a48:b0:88a:529a:a53a with SMTP id 6a1803df08f44-894ea09691emr43666386d6.51.1769781379597; Fri, 30 Jan 2026 05:56:19 -0800 (PST) Received: from ziepe.ca (hlfxns017vw-142-162-112-119.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.162.112.119]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-894d376da66sm59670316d6.50.2026.01.30.05.56.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 30 Jan 2026 05:56:19 -0800 (PST) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1vloyw-0000000AmRb-29H1; Fri, 30 Jan 2026 09:56:18 -0400 Date: Fri, 30 Jan 2026 09:56:18 -0400 From: Jason Gunthorpe To: Christian =?utf-8?B?S8O2bmln?= Cc: Leon Romanovsky , Sumit Semwal , Alex Deucher , David Airlie , Simona Vetter , Gerd Hoffmann , Dmitry Osipenko , Gurchetan Singh , Chia-I Wu , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Lucas De Marchi , Thomas =?utf-8?Q?Hellstr=C3=B6m?= , Rodrigo Vivi , Kevin Tian , Joerg Roedel , Will Deacon , Robin Murphy , Felix Kuehling , Alex Williamson , Ankit Agrawal , Vivek Kasireddy , linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-kernel@vger.kernel.org, amd-gfx@lists.freedesktop.org, virtualization@lists.linux.dev, intel-xe@lists.freedesktop.org, linux-rdma@vger.kernel.org, iommu@lists.linux.dev, kvm@vger.kernel.org Subject: Re: [PATCH v5 4/8] vfio: Wait for dma-buf invalidation to complete Message-ID: <20260130135618.GC2328995@ziepe.ca> References: <20260124-dmabuf-revoke-v5-0-f98fca917e96@nvidia.com> <20260124-dmabuf-revoke-v5-4-f98fca917e96@nvidia.com> <31872c87-5cba-4081-8196-72cc839c6122@amd.com> <20260130130131.GO10992@unreal> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Fri, Jan 30, 2026 at 02:21:08PM +0100, Christian König wrote: > That would work for me. > > Question is if you really want to do it this way? See usually > exporters try to avoid blocking such functions. Yes, it has to be this way, revoke is a synchronous user space triggered operation around things like FLR or device close. We can't defer it into some background operation like pm. > >>> } > >>> fput(priv->dmabuf->file); > >> > >> This is also extremely questionable. Why doesn't the dmabuf have > >> a reference while on the linked list? If we hold a refcount while on the list then the FD can never be closed. There is locking protecting the list so that it is safe and close continues to work right. Jason