From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 19650329C54; Thu, 23 Oct 2025 14:22:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761229327; cv=none; b=sowpM3ctdKsQvSIgpriDT8LwXHNYUTx3Nla2mbOWAXpVlfHKQ5ZbVoj1juF1BN4WyGDZSsshJxiGIBUnYQLvkSYjuUYUbj9xBXe5ef8u4qgcpPRw2pc8oOlFvv3DPgRVOuUqtz7/1zE3IlRAR3M9sDYwmXAwZjU5ief2hGccjsE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761229327; c=relaxed/simple; bh=BwVZtl/HIj1iRCV/Fdz6OwZ0QLc/wzCP70++aKaFxFU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=QcEV7bfnvZbvqeEHmcsr9Ixkyr6/9tr+kyIW3hAThUjwBbs0CrAzOQrKCBN8OwdsaJ38F3DgUwAXHKAGiut5aV4+ZKg9UagRbmkzC1tMW9UhRhiyRCJtF2Pc8Mb6MLqmWuQd3A4cTToIXfVJlfPlDl1uRmqtihBfDNUBsgioB+s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=V5my/Pqn; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="V5my/Pqn" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D1742C4CEE7; Thu, 23 Oct 2025 14:22:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1761229326; bh=BwVZtl/HIj1iRCV/Fdz6OwZ0QLc/wzCP70++aKaFxFU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=V5my/Pqn+1981uSoUy1l6CF8qdPds2iW1umFa2+sJbOMddFl325hLnidhmRzyZS14 sfY9Cb8pTSgxLuWXxkIazCxqx+TlbQEmyuql5YftNlW9CCHSwpO6p4ikuaTUbPOCEU uAbN8RK3cfK3D2FcKrwq6kX3nEiYX36Knn/aNRk+FKSOY8BSA/32CLDbsf9QC4zV/1 zczToWolqvpLRYeUUdqgcJAsP4sDpJPw2/8GIJcCRqV/rJMxs0M+o+/Ed3fl0r1E8M MJjdHAK2VW2jVMvreSpSnn2S5E/CxfsWB0/vE62rbB3dGcRkrrIIkDQ1UJfep36nf3 JHGseOPCCsZww== Date: Thu, 23 Oct 2025 22:22:01 +0800 From: Tzung-Bi Shih To: Jason Gunthorpe Cc: Benson Leung , Greg Kroah-Hartman , "Rafael J . Wysocki" , Danilo Krummrich , Jonathan Corbet , Shuah Khan , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, chrome-platform@lists.linux.dev, linux-kselftest@vger.kernel.org, Laurent Pinchart , Bartosz Golaszewski , Wolfram Sang , Simona Vetter , Dan Williams Subject: Re: [PATCH v5 5/7] revocable: Add fops replacement Message-ID: References: <20251016054204.1523139-6-tzungbi@kernel.org> <20251016123149.GA88213@nvidia.com> <20251017134916.GK3901471@nvidia.com> <20251017162116.GA316284@nvidia.com> <20251020115734.GH316284@nvidia.com> <20251021121536.GG316284@nvidia.com> Precedence: bulk X-Mailing-List: linux-doc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20251021121536.GG316284@nvidia.com> On Tue, Oct 21, 2025 at 09:15:36AM -0300, Jason Gunthorpe wrote: > On Tue, Oct 21, 2025 at 04:49:59AM +0000, Tzung-Bi Shih wrote: > > > I didn't get the idea. With a mutex, how to handle the opening files? > > > > Are they something like: (?) > > - Maintain a list for opening files in both .open() and .release(). > > - In misc_deregister_sync(), traverse the list, do something (what?), and > > wait for the userspace programs close the files. > > You don't need any list, we don't want to close files. > > Something like this, it is very simple. You can replace the rwsem with > a srcu. srcu gives faster read locking but much slower sync. > > [...] I see. The idea is basically the same but don't use revocable at all. I was misunderstanding about the "sync" we were discussing for misc_deregister_sync(). The "sync", is analogous to synchronize_srcu() of revocable_provider_revoke() in the revocable version [1], doesn't wait for closing all opened files. [1] https://lore.kernel.org/chrome-platform/aPT-7TTgW_Xop99j@tzungbi-laptop/