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 3B8A2EA3F27 for ; Wed, 11 Feb 2026 15:53:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 925C610E0AB; Wed, 11 Feb 2026 15:53:41 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="WaH5AqO2"; dkim-atps=neutral Received: from mail-wm1-f73.google.com (mail-wm1-f73.google.com [209.85.128.73]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0FE6A10E0AB for ; Wed, 11 Feb 2026 15:53:40 +0000 (UTC) Received: by mail-wm1-f73.google.com with SMTP id 5b1f17b1804b1-480717a8ef9so9591975e9.1 for ; Wed, 11 Feb 2026 07:53:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1770825218; x=1771430018; darn=lists.freedesktop.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=Fo7WKYebi3fAlOUB+zK2I6teKG+LDSaCT9sMVh6hilE=; b=WaH5AqO2znX7ZLQaQwzbhmGujMvwCE136n5LSdFDsD5lVRsNpVSjRqGFIK/qfjW1e7 aXYaYq5DJzjtIjgSmxEcARiWqxK+ON5skdV/jyWgFwTxR+Sp9iLFhpWb8+lqhRMzCX7+ u0hWQyLY3Qb3gsy/1VavkxxfSEB3QrGlowVZYewqMR9FuJ8QFSelnQp3wfInIkZfpVFD 0+cph14eJoZhLScx3aWDk9U5eZFg1T4Ky7lFxNP7+o4FCFnEJcrqejCfxzIgRF4OUpOd VmLBNe3asFEFBl2pstjuCjcdNoIs9wGQI1vOmDpu+eDOAgXRTFuVGCzJ9RVGBqzC8DMX SEPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770825218; x=1771430018; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Fo7WKYebi3fAlOUB+zK2I6teKG+LDSaCT9sMVh6hilE=; b=d9Uybm+Vz0T+60GW8Gr247Z9fE2zOA4FRnUaXBM4w4CYWiaS3Z5ORd3K0iQ2UTv2L4 SkXWRHD91WoZIZ+kMUiUyVBcGmFFhx+LfyAG/pGeQwPT8nb72mAi5NDeEkvSFozb/aF4 l69SfswleYr8T/28PPMJrHWHbQKno8Q1z6Eafk0mxLeKHqrIbCHfGGkQKpIazM3AP/qx 2GykMJ379iMEbfFOhS6Sf0syCuSYyfxRWo7FlWpRPDIgdF/o8fEvkfAENNmF3u5jH9OJ Nt5JiaIbwHLORoftQAEsHFE3g3jqZxLSDY/OczQ1Cmf8a0D+oMlMi1Ar62+z+fPsmRMq U21Q== X-Forwarded-Encrypted: i=1; AJvYcCUF/HDXkgphWjR47+WUxQsDLpFGmxiqzg100od5ngpS6l+qyzZifL8Ea9cABy1ioC7imqDjjr+PU8I=@lists.freedesktop.org X-Gm-Message-State: AOJu0YwGQRxtzzD5MyJjhf2/NLWo5l6qDSlojCdo4TPNASq4GgGXRG0I lIE9/h1VkmoQCzom2wwkeHE7YbVf5pTgiRwkhD4176jQeO/OFg76LAyIQQK++pQx21vWOdvqMAG +sfAcxIQZ5Kc4ULbWDw== X-Received: from wmov20.prod.google.com ([2002:a05:600c:4714:b0:480:4a03:7b5c]) (user=aliceryhl job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:35d2:b0:47e:e2b8:66e6 with SMTP id 5b1f17b1804b1-48350547564mr88179375e9.14.1770825218555; Wed, 11 Feb 2026 07:53:38 -0800 (PST) Date: Wed, 11 Feb 2026 15:53:37 +0000 In-Reply-To: Mime-Version: 1.0 References: <20260203081403.68733-5-phasta@kernel.org> <20260210155750.5cdbe6cc@fedora> <8ea48ce49f2c7b6fd715dd54c24e755e8ac3262c.camel@mailbox.org> <20260211120742.0e9e7122@fedora> <20260211150738.049af4bb@fedora> Message-ID: Subject: Re: [RFC PATCH 3/4] rust/drm: Add DRM Jobqueue From: Alice Ryhl To: phasta@kernel.org Cc: Boris Brezillon , Gary Guo , David Airlie , Simona Vetter , Danilo Krummrich , Benno Lossin , "Christian =?utf-8?B?S8O2bmln?=" , Daniel Almeida , Joel Fernandes , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, rust-for-linux@vger.kernel.org Content-Type: text/plain; charset="utf-8" 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 Wed, Feb 11, 2026 at 04:20:15PM +0100, Philipp Stanner wrote: > On Wed, 2026-02-11 at 15:17 +0000, Alice Ryhl wrote: > > On Wed, Feb 11, 2026 at 03:07:38PM +0100, Boris Brezillon wrote: > > > > > > Back to this particular job dependencies use case: we have to embed the > > > DmaFence pointer in some wrapper with the ListLinks element anyway, > > > because DmaFences can be inserted in multiple of those lists in > > > parallel. > > > > Okay, if that's the case, then the linked list is *really* not the right > > tool for the job. > > We have to distinguish what we are talking about here. > > For the JobQueue, it takes over a cloned DmaFence and stuffs that into > its own list. Problem solved. > > Whether the driver has other clones of that fence in other list is not > relevant because it's not the same list head. > > JQ's lists and list heads are internal. > > I don't see a problem. I'm talking about this allocation: pub fn add_dependency(&mut self, fence: ARef>) -> Result { let dependency = Dependency::new(fence)?; and this one: pub fn submit_job(&self, mut job: Pin>>) -> Result>> { [...] let wrapped_job = JobWrap::new(job)?; Replacing `dependencies` with a KVec and `waiting_jobs` with xarray would cause these to use less memory, fewer allocations, and be faster. And it would solve the raw pointer in HwFenceWaker, as you can use the address (or other ID) of the Job as key to look up in the xarray. For `dependencies` there's no need to worry about the vector growing too large, because the vectors are not long-lived: when the fence signalled the entire vector can be freed. As for waiting_jobs, the xarray auto-shrinks its memory usage, so no problem there. Alice