From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f74.google.com (mail-wm1-f74.google.com [209.85.128.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3D38E253F05 for ; Wed, 11 Feb 2026 15:53:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.74 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770825221; cv=none; b=TaJmgxxLN9Wkx5J7hqCVlbmCP2OVTqZnz1mPvrvLlft5jfbJZtYMA81lJQavQCnXXZKXyyaCJ1ge+C8tUrIiPM3W6l+gGI6gwHZRau9RJHvPVfBm/am+m4rxKKwzGrRCpDaxC9ZXXIyEtU7d291gkadGF3+1w9N/I0jBd/Im0+Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770825221; c=relaxed/simple; bh=CgMTUjg8cMuQiWwcY9AuIP07bDr48KxocPQ7VDQ2FLo=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=ag/dxg33l+12LYG83/XTSqNWnZ6J9+uJB+HjlExzveLc1qFzRUdjTKoD+NoEdQrmMcUP44KNJPWMB82aQeVBwilD7vu1QwCj1yTbEBtBuLaN8/cEzRXn5ZqxMcsHsQnfuIhtIlKbbTSqJLPEi3zH3toLjd0iYCqD7Qo3BMn6oe8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--aliceryhl.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=H4nCOMNZ; arc=none smtp.client-ip=209.85.128.74 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--aliceryhl.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="H4nCOMNZ" Received: by mail-wm1-f74.google.com with SMTP id 5b1f17b1804b1-480717a8ef9so9591935e9.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=vger.kernel.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=H4nCOMNZwBwyb/rZU7xaFST7a7ZUsaYGGJidJdkITKbtDP0ePTSCHDxxeoEkbp8CFn QIhmXKp21O1IYjAVRIockb3zALfnBn4idRbOAofiPC6TNKkiSrJI34XP/6rVUvXPCqIO TLghmXTBS/6IVafaUhsgkQNLXImXA9SUEQE7tf5FMgT66Ivkn9YJ0R1IKh2zbDtlrfdp W26pSUSATF9/QF7GkeqvImweXPD+ajTy6B0+UQG9X9Tmxzvm0UDErA3R3YGP/9jUGUdI NmLliYybF+KCRTY402Qt4eirPccxRBfMQ71qTA8Mg2w1KJQlfuvUnu1MfC8uDUm3/HFH NtIQ== 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=vjfWX5uexAmWZPA24NgWNEvogRzCROqGOgto/aCI/BxaHtmhdZBF/K6B43Txg9ldCR GIKlFhN5jAeEdx9d74Ww0b/wvkejYFQmxsULstyulGwdiZORHbAlCCE7Mj3h1j7vrjvd HXDECkSljaQofxU2TnS0zAuspGTVoK8rVIsRcW7QAIGXRgkh2dGOeRwaoNspKm/ipw9F yrrmEPgVhn4LusXTHICb5L0m7DWGoYXM4u3mZd4ar8MfDlyXk1yJgdGDxwleX/QHObhW TsxBwBDd9YYXT8CbiOYNNqyz5qWH7RHENydpA6ZLCpLwIIkHVINUxJi7TH5BcSvPN46q rySA== X-Forwarded-Encrypted: i=1; AJvYcCUkR1anO/SI6evSWrNR0/czBcpdrEQsaYgJJiIIjnqtnzc6ETXyvD3es32SdmVvxC0MTONC+6DVTH3W5w0=@vger.kernel.org X-Gm-Message-State: AOJu0YzmJvXFpw+j4+SRkzzruruWsFPrdQvwUvLz24UTj9CS3yWeXiTX 43WoEyeZG64N0dc76fDcAJ0uAtJspJuAtdAhfK7VAm7DCNSwrco43QKhGom5NtNkFLVVWNwtZWq hYBOQK3rRMQFdfDmYwg== 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: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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" 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