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 2561ACCD1BB for ; Wed, 22 Oct 2025 14:03:12 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9A70D10E7A6; Wed, 22 Oct 2025 14:03:11 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="iuQdA5kn"; dkim-atps=neutral Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0260A10E7A6; Wed, 22 Oct 2025 14:03:09 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 9E08743F38; Wed, 22 Oct 2025 14:03:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F386EC4CEE7; Wed, 22 Oct 2025 14:03:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1761141789; bh=xrm1w4yERgygRqUBRscWdCpDySrnBpn65cTh+rqN8Fc=; h=Date:Subject:Cc:To:From:References:In-Reply-To:From; b=iuQdA5knu9fbzUeMyBzyFXIYOrU8bEtrfVnvcpqKELvI7oDxRjOAyX59cVcN1PFXq RjGlhFkqm/n9H7B8FUG0wlPGiQ/xNMe9Qui39yqjSLMI5cb3PR5WLfsUv67JXoYbmi xBYl9GWwmTpRYPj7348jHy7bbWr7kgi7Ener/UE+icLfFwQ8yFNgiai2UxzCHk3qAh vDF6OMsETEHLtETztGJcbEsb7MHxOtn0kw0cqyxhu/b5m7IJTXOc48oFOfDOCrLMfh jGiG/9wPwIKqqnlY8MQNiOdsw8o5M4qfilgKjVg0fcUPlt3WM2LUNBCRLQbKPptnbf b+laQfdlNpIrA== Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Wed, 22 Oct 2025 16:03:06 +0200 Message-Id: Subject: Re: [PATCH v2 09/27] drm/sched: Add fair scheduling policy Cc: , , , , =?utf-8?q?Christian_K=C3=B6nig?= , "Matthew Brost" , "Pierre-Eric Pelloux-Prayer" To: "Tvrtko Ursulin" From: "Danilo Krummrich" References: <20251017133644.44747-1-tvrtko.ursulin@igalia.com> <20251017133644.44747-10-tvrtko.ursulin@igalia.com> <2f1eb1943d4d6a7185391e6d35e9c5d9818649da.camel@mailbox.org> In-Reply-To: X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" On Wed Oct 22, 2025 at 3:50 PM CEST, Tvrtko Ursulin wrote: > Yes, for the case when entity joins the run-queue it can be the same=20 > entity which is now the head of the queue, or it can be a different one.= =20 > Depends on the insertion position. > > But for the case where entity is leaving the run queue it is always a=20 > different entity and therefore a lock inversion. We have essentially this= : > > lock entity > lock rq > remove entity from the rq > rq->prio =3D rq->head_entity->prio // different entity, unlocked read > unlock rq > unlock entity This sounds like it repeates the unclear locking situation that is also documented for struct drm_sched_rq: * FIXME: Locking is very unclear for this. Writers are protected by * @lock, but readers are generally lockless and seem to just race with * not even a READ_ONCE. This sounds pretty suspicious to me and I think it indicates a more fundame= ntal design issue that you now end up working around now. I'd like to dig in a bit more, but unfortunately it's very unlikely I will = have the time to do this until after LPC.