From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=80.241.56.152 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796288978; b=oHZPh0DFuTTXJREXIkZmciumRAOBlYXn1A8fIxrYbBhrjvgZ+zpJmX80WHSUiLXPivH6 RhDX1vPBtpcdWu+AVgPnxYiIgDzHoYkJCIzFOEGnh78AEaVPsos78ynp2VGL/XGYTsvtY 2MzCj9g/BQVNFrrB3/Vc4Qnxpsm3X4L2/Ki4mFTdyaiJUMniRBFR393MPuY8DS1zKuRNs V/8rxk0UHIbBsvy1uj1xmS5/NhsHQkclYyrgbkFBK2+3vfhiBUES/zw23PCoXVlUOyrRO 5Puhv+Csgo3Mkh9Zv8P0IaBSqTXrJ3Xi5DkYiKlqyYWA0ZHCEDn8C6xYb7rtexkEE+A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796288978; h=DMARC-Filter:Received:DKIM-Signature:Message-ID:Subject:From: Reply-To:To:Cc:Date:In-Reply-To:References:Content-Type: Content-Transfer-Encoding:User-Agent:MIME-Version:X-MBO-RS-ID: X-MBO-RS-META; bh=VmcSP2CP0Gyw8YOpqG74VnAMcyM5bXTG/WJjyrIh/lQ=; b=LHuZNwzK8UHuIQcKrVDnBlOpLdwJwGhlFavDvzPyskweqHE09RQfIgAHOPVrXgtnlX62 o6umvnazbInlssbjXax/LwWRI5T2BkOez32xrIGwcNB5EbIS8Zr+pAu32MARQemW1DZKc ss2xEm1Jd63+1O2DDzeJS0QxKAZ47zbBQEwejsLbwJ7ZxgMiWV9gGdRL3/NZRnohgWErf nHvjzrySxTg13HghKAUI60euH1gZ0Pfg6vU1I7sp6b63Qdmbvai/VEvJR5cAXUxATZ1jl 5BIqrLeNDonK/pUybGBK8fW5/3Whla+/G5KO6lYb4XlBrMtdD4jTUyuawrEdfZIN02Q== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=mailbox.org; spf=pass smtp.mailfrom=mailbox.org; dkim=pass header.d=mailbox.org header.i=@mailbox.org header.a=rsa-sha256 header.s=mail20150812 header.b=KOo5JNcE; arc=none smtp.remote-ip=80.241.56.152 Received: from mout-p-102.mailbox.org (mout-p-102.mailbox.org [80.241.56.152]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DB1D4606A322 for ; Thu, 3 Dec 2026 09:09:37 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org DB1D4606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=mailbox.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mailbox.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mailbox.org header.i=@mailbox.org header.a=rsa-sha256 header.s=mail20150812 header.b=KOo5JNcE Received: from smtp102.mailbox.org (smtp102.mailbox.org [IPv6:2001:67c:2050:b231:465::102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519MLKEM768 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-102.mailbox.org (Postfix) with ESMTPS id 4jg82k55S2zKnCL; Thu, 03 Dec 2026 10:09:34 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1796288974; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=VmcSP2CP0Gyw8YOpqG74VnAMcyM5bXTG/WJjyrIh/lQ=; b=KOo5JNcE7dT2SSNHPEnBSNan7hz6o0Ue8yMT4UELjkWMcs0V9bL1rMGKwdz7iBBugJqrmI oRWjGV7dZ7tfvauAHoZ7F/HxX3tvl0qj5cdmH539hd7fWHLK0FyeAhUdJTR0hM2ajQWBNe HTAlSF6QeLkM5Yi+jlmsLWzJ2wtrKUExhSz4sPmD+JZoTt+Xmzbl0pMbub78A9BJdtQrRr npdo/fVCPHv3PaHwbxQuIN1q59lQJlFwfjjSLE7lqHVhiltbYVCLpiKyt9Wx/9Nm+o/HN6 D63QLeKAX3Mj+m6U5IwplB9jDcagWpH0hPn/6Jax3vxAzsLV+/g6rGd5mND8sg== Message-ID: Subject: Re: [PATCH] accel/rocket: Parallelize independent jobs across cores From: Philipp Stanner Reply-To: phasta@kernel.org To: Gyeyoung Baek , Tvrtko Ursulin Cc: Tomeu Vizoso , Oded Gabbay , Heiko Stuebner , David Airlie , Simona Vetter , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , dri-devel@lists.freedesktop.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Philipp Stanner , Danilo Krummrich , Christian =?ISO-8859-1?Q?K=F6nig?= Date: Thu, 03 Dec 2026 10:09:31 +0100 In-Reply-To: References: <20261202100555.3122236-1-gye976@gmail.com> <29badb49-7a4c-44af-be4d-f464e949452b@ursulin.net> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.60.2 (3.60.2-3.fc44) X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 X-MBO-RS-ID: c44bb118151934b02b0 X-MBO-RS-META: bde373gwpeoi3mh6bjbyet3cddb8y19d +Cc Christian On Thu, 2026-12-03 at 13:12 +0900, Gyeyoung Baek wrote: > > > In general, the problem with why a single entity does not work really= is > > > that drm_sched_entity_select_rq() has this artificial coupling > > > preventing run queue / scheduler changes while there are queued or > > > active jobs in the entity. In the ideal world it should work. > >=20 > > Scratch this, I got confused due context switching. One entity shouldn'= t > > execute in parallel to itself is fundamental. >=20 > Yes. So an entity alone can't run jobs that don't depend on each other > concurrently on the cores of hardware like rocket. >=20 > I think drm_sched needs a new queue object, separate from the entity, > that orders jobs only by their dependencies: >=20 > - An entity orders its jobs in two ways: > =C2=A0 1. the dependency fences of each job > =C2=A0 2. the order in which the jobs were queued I don't think that's a formally correct description. jobs within an entity are always ordered as FIFO, hence point 2 from your list. Dependency fences merely determine which entity is runnable. >=20 > - The problem is 2. Because of it, a job waits for the job queued before > =C2=A0 it even without a dependency, so rocket had to work around it with= one > =C2=A0 entity per core. Can you elaborate a bit more how your hardware works. So what other drivers call their ring, for you consists of multiple cores, and each core can process 1 job in parallel? If my description above is correct, then it would seem that having one entity per core is the right thing to do. Or do they then not match the user(space) queues? > - 1 can express 2: if each job depends on the previous one, we get 2. > =C2=A0 So an interface that orders jobs by 1 alone is the more general on= e. >=20 > I also think drm_sched should provide this, as other multi-core > accelerators need the same (e.g. the thames driver). I only did it in > rocket to start small. >=20 > Please let me know if I got anything wrong so far. Otherwise I'll send > an RFC. drm_sched is unfortunately not a very stable code base, so if we can avoid a big rework completely re-conceptualizing the concept of an entity, that would be kind of nice :( Thx Philipp