From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mout-p-101.mailbox.org (mout-p-101.mailbox.org [80.241.56.151]) (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 91CE933F580 for ; Thu, 5 Mar 2026 09:47:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.241.56.151 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772704077; cv=none; b=DDNvTtlr5+2f7OGpcbEk5de9hDMiZ6+6xXM+Q5Iut/Aq3nWakSDUaYgAZHPzXlLHLS1VfacFmHvm+yaA4WbaeIeGO2Xuijp9d/fXpI+csfEr1wWUMDO0q5iFiCBAT6O12QANJAUmpB1/sK/ntYwiterZHDieVlr6z9gevMME8n0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772704077; c=relaxed/simple; bh=VgcI+DsjIo+X5y77Bh+h4cJr9LBB4NMoAn0ElwmoKvQ=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=Y0PiuZfAii/KGDDZPkvxgVxaUHvTWTT/xlHJ2hRDf5BsJqKyksVdz61ZckyFSScKCNIjhT/i+fGBsWMgEZzxedbjjUZsM0xsEaumOx0IYCSam9vh5NyLa3YgaZJaQDsexOkgraux73uxzMchtdvwv9lN4RCZd42RLaBN8LQNnj0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=mailbox.org; spf=pass smtp.mailfrom=mailbox.org; dkim=pass (2048-bit key) header.d=mailbox.org header.i=@mailbox.org header.b=W4zuc5D5; arc=none smtp.client-ip=80.241.56.151 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.b="W4zuc5D5" Received: from smtp202.mailbox.org (smtp202.mailbox.org [10.196.197.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4fRPpj3CQMz9tkb; Thu, 5 Mar 2026 10:47:41 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1772704061; 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=VgcI+DsjIo+X5y77Bh+h4cJr9LBB4NMoAn0ElwmoKvQ=; b=W4zuc5D5cNI3RCI35WR/DXP9IUv2XaX8Ab2O/HrMO0aOhvzuofrdP1DOb4/81attKHBMjP ZGLmUEApEDfn9P5whAkOTad7g5ZBUfe+70dcdHfNqRBDKtgCvVrMowQN9nGozZtGq18Uum qhgw3NuIXtb6/aGCA9T2KqILQGq8OjRmPCvuWRwoqlJmDwgVQkH6y9XswdIx1XQLtoo9IX FhTt+KEOdlfpKIBHkxlgdeZyU6hp09Owb7raxuU0dWoLN1ioT5uvOO4spOrSOCrq+c1/Db BvyI0uree9AALizyd3EWWxyzc/xZD4uI9C+Pn0ejQ751vcASx1C7Qs9Ky56krw== Message-ID: <9949a2c27b2a1dc1cde10dbb89edec53411614b1.camel@mailbox.org> Subject: Re: drm_sched run_job and scheduling latency From: Philipp Stanner Reply-To: phasta@kernel.org To: Matthew Brost , phasta@kernel.org Cc: Boris Brezillon , Chia-I Wu , ML dri-devel , intel-xe@lists.freedesktop.org, Steven Price , Liviu Dudau , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Danilo Krummrich , Christian =?ISO-8859-1?Q?K=F6nig?= , Thomas =?ISO-8859-1?Q?Hellstr=F6m?= , Rodrigo Vivi , open list , tj@kernel.org Date: Thu, 05 Mar 2026 10:47:32 +0100 In-Reply-To: References: <20260305092711.20069ca1@fedora> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MBO-RS-ID: e63af98d95a1cb7dea4 X-MBO-RS-META: 9hoe9nn3g1rfjpzptturo9ewmq4u4aa1 On Thu, 2026-03-05 at 01:10 -0800, Matthew Brost wrote: > On Thu, Mar 05, 2026 at 09:38:16AM +0100, Philipp Stanner wrote: > > On Thu, 2026-03-05 at 09:27 +0100, Boris Brezillon wrote: > >=20 > > >=20 [=E2=80=A6] > > > Honestly, I'm not thrilled by this fast-path/call-run_job-directly id= ea > > > you're describing. There's just so many things we can forget that wou= ld > > > lead to races/ordering issues that will end up being hard to trigger = and > > > debug. > > >=20 > >=20 > > +1 > >=20 > > I'm not thrilled either. More like the opposite of thrilled actually. > >=20 > > Even if we could get that to work. This is more of a maintainability > > issue. > >=20 > > The scheduler is full of insane performance hacks for this or that > > driver. Lockless accesses, a special lockless queue only used by that > > one party in the kernel (a lockless queue which is nowadays, after N > > reworks, being used with a lock. Ah well). > >=20 >=20 > This is not relevant to this discussion=E2=80=94see below. In general, I = agree > that the lockless tricks in the scheduler are not great, nor is the fact > that the scheduler became a dumping ground for driver-specific features. > But again, that is not what we=E2=80=99re talking about here=E2=80=94see = below. >=20 > > In the past discussions Danilo and I made it clear that more major > > features in _new_ patch series aimed at getting merged into drm/sched > > must be preceded by cleanup work to address some of the scheduler's > > major problems. >=20 > Ah, we've moved to dictatorship quickly. Noted. I prefer the term "benevolent presidency" /s Or even better: s/dictatorship/accountability enforcement. How does it come that everyone is here and ready so quickly when it comes to new use cases and features, yet I never saw anyone except for Tvrtko and Ma=C3=ADra investing even 15 minutes to write a simple patch to address some of the *various* significant issues in that code base? You were on CC on all discussions we've had here for the last years afair, but I rarely saw you participate. And you know what it's like: who doesn't speak up silently agrees in open source. But tell me one thing, if you can be so kind: What is your theory why drm/sched came to be in such horrible shape? What circumstances, what human behavioral patterns have caused this? The DRM subsystem has a bad reputation regarding stability among Linux users, as far as I have sensed. How can we do better? >=20 > >=20 >=20 > I can't say I agree with either of you here. >=20 > In about an hour, I seemingly have a bypass path working in DRM sched + > Xe, and my diff is: >=20 > 108 insertions(+), 31 deletions(-) LOC is a bad metric for complexity. >=20 > About 40 lines of the insertions are kernel-doc, so I'm not buying that > this is a maintenance issue or a major feature - it is literally a > single new function. >=20 > I understand a bypass path can create issues=E2=80=94for example, on cert= ain > queues in Xe I definitely can't use the bypass path, so Xe simply > wouldn=E2=80=99t use it in those cases. This is the driver's choice to us= e or > not. If a driver doesn't know how to use the scheduler, well, that=E2=80= =99s on > the driver. Providing a simple, documented function as a fast path > really isn't some crazy idea. We're effectively talking about a deviation from the default submission mechanism, and all that seems to be desired for a luxury feature. Then you end up with two submission mechanisms, whose correctness in the future relies on someone remembering what the background was, why it was added, and what the rules are.. The current scheduler rules are / were often not even documented, and sometimes even Christian took a few weeks to remember again why something had been added =E2=80=93 and whether it can now be removed again = or not. >=20 > The alternative=E2=80=94asking for RT workqueues or changing the design t= o use > kthread_worker=E2=80=94actually is. >=20 > > That's especially true if it's features aimed at performance buffs. > >=20 >=20 > With the above mindset, I'm actually very confused why this series [1] > would even be considered as this order of magnitude greater in > complexity than my suggestion here. >=20 > Matt >=20 > [1] https://patchwork.freedesktop.org/series/159025/=C2=A0 The discussions about Tvrtko's CFS series were precisely the point where Danilo brought up that after this can be merged, future rework of the scheduler must focus on addressing some of the pending fundamental issues. The background is that Tvrtko has worked on that series already for well over a year, it actually simplifies some things in the sense of removing unused code (obviously it's a complex series, no argument about that), and we agreed on XDC that this can be merged. So this is a question of fairness to the contributor. But at one point you have to finally draw a line. No one will ever address major scheduler issues unless we demand it. Even very experienced devs usually prefer to hack around the central design issues in their drivers instead of fixing the shared infrastructure. P.