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 91725EA810A for ; Tue, 10 Feb 2026 12:56:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D88E510E575; Tue, 10 Feb 2026 12:56:38 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=collabora.com header.i=@collabora.com header.b="J+WJQ+EZ"; dkim-atps=neutral Received: from bali.collaboradmins.com (bali.collaboradmins.com [148.251.105.195]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1748210E575 for ; Tue, 10 Feb 2026 12:56:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1770728196; bh=3sVx9kzC9+Y0SUyoKk1lED+Isv1q31yWZzTbhf4FnVU=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=J+WJQ+EZhWNtRq87NGKEdiCqZIe0Ga8pc6rXhTypqK8UapDD8I+mK4g6g5wwLHJUl aNiElLlRGKxm5LS8q/vuCsmuwqNxPdSqPNcT3Vf4rYwPpPz5RTWNRDSmCGAlQ8H0pc 4Xy9EprW0HhNWbd7Be8fN0RWI5ae9mlo3d8MAy4l58vq2U+7oinEMg5Dl7g0BcBEh3 ekBqs0Wg8rloCtVj9EPHsfpb+Mv/JFNMljYUxOdmOR3x0OSTxyXmGV8EmQb6ZDIbsU sleWwTeMG4ZG68G2B7KCQ3lRIsUyqkO4r/9piSmRQ6fyQRTe0Bb03VvXkt8Qoj+Ifj V9ZRp7V4i4HDA== Received: from fedora (unknown [IPv6:2a01:e0a:2c:6930:d919:a6e:5ea1:8a9f]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bbrezillon) by bali.collaboradmins.com (Postfix) with ESMTPSA id 17CA717E126B; Tue, 10 Feb 2026 13:56:36 +0100 (CET) Date: Tue, 10 Feb 2026 13:56:26 +0100 From: Boris Brezillon To: Alice Ryhl Cc: "Christian =?UTF-8?B?S8O2bmln?=" , Philipp Stanner , phasta@kernel.org, Danilo Krummrich , David Airlie , Simona Vetter , Gary Guo , Benno Lossin , Daniel Almeida , Joel Fernandes , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, rust-for-linux@vger.kernel.org Subject: Re: [RFC PATCH 2/4] rust: sync: Add dma_fence abstractions Message-ID: <20260210135626.0fe9b590@fedora> In-Reply-To: <20260210134913.33cb674f@fedora> References: <20260203081403.68733-2-phasta@kernel.org> <20260203081403.68733-4-phasta@kernel.org> <20260205095727.4c3e2941@fedora> <20260209155843.725dcfe1@fedora> <20260210101525.7fb85f25@fedora> <20260210134913.33cb674f@fedora> Organization: Collabora X-Mailer: Claws Mail 4.3.1 (GTK 3.24.51; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 Tue, 10 Feb 2026 13:49:13 +0100 Boris Brezillon wrote: > On Tue, 10 Feb 2026 10:15:04 +0000 > Alice Ryhl wrote: > > > /// The owner of this value must ensure that this fence is signalled. > > struct MustBeSignalled<'fence> { ... } > > /// Proof value indicating that the fence has either already been > > /// signalled, or it will be. The lifetime ensures that you cannot mix > > /// up the proof value. > > struct WillBeSignalled<'fence> { ... } > > Sorry, I have more questions, unfortunately. Seems that > {Must,Will}BeSignalled are targeting specific fences (at least that's > what the doc and 'fence lifetime says), but in practice, the WorkItem > backing the scheduler can queue 0-N jobs (0 if no jobs have their deps > met, and N > 1 if more than one job is ready). Similarly, an IRQ > handler can signal 0-N fences (can be that the IRQ has nothing to do we > job completion, or, it can be that multiple jobs have completed). How > is this MustBeSignalled object going to be instantiated in practice if > it's done before the DmaFenceWorkItem::run() function is called? For the scheduler WorkItem (assuming a JobQueue model), it's kinda doable, because this is a FIFO, and we can get the first job in the queue (and thus the fence attached to this job) quite easily, but as soon as it's a post-execution WorkItem or IRQHandler, we never know when entering WorkItem::run()/ThreadedHandler::handle_threaded() which job will be completed (if any).