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 1CAC5C5AD49 for ; Tue, 3 Jun 2025 09:32:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6E1E910E5AB; Tue, 3 Jun 2025 09:31:59 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="h3OdthMY"; 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 08BCE10E6E7; Tue, 3 Jun 2025 09:31:57 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 0E48E44D62; Tue, 3 Jun 2025 09:31:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BAA01C4CEED; Tue, 3 Jun 2025 09:31:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1748943115; bh=NeI11bo1EpvzZ96f+dx/8BGkkc1I9vz5CC22goQdva4=; h=From:To:Cc:Subject:Date:From; b=h3OdthMYGcN65/9QIDtIr68la5NKp/xISlIPDjcRADB4wcBcYrMurYTauqIL6pYns KfvfgGNsxWv9Ju/0R7JPEWM05zIin43eIol6obEUp5R8B2CPuPPoBLzADHSAxLVL5P Q7SHVC5BOe8MRnsPLSPdcmSA0950HI4Plkj5j9891hI3wn5bfPzLeU9Ktle3dTz9Xm ZHAMrNS6jvA/hVti4bU2AUZ5+K9pKZp0CZfgnCeww9pU7kUWVSoTVqC5cLp+rQe3QU C6iSfeVdHPG00ReajIphii6S9cPj/npVzE4GE0FEuh/dkUBuc5bpm5hoJSCgMfgViI bPbolon0JprqA== From: Philipp Stanner To: Lyude Paul , Danilo Krummrich , David Airlie , Simona Vetter , Matthew Brost , Philipp Stanner , =?UTF-8?q?Christian=20K=C3=B6nig?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Sumit Semwal , Tvrtko Ursulin , Pierre-Eric Pelloux-Prayer Cc: dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: [RFC PATCH 0/6] drm/sched: Avoid memory leaks by canceling job-by-job Date: Tue, 3 Jun 2025 11:31:25 +0200 Message-ID: <20250603093130.100159-2-phasta@kernel.org> X-Mailer: git-send-email 2.49.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: nouveau@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Nouveau development list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: nouveau-bounces@lists.freedesktop.org Sender: "Nouveau" An alternative version to [1], based on Tvrtko's suggestion from [2]. I tested this for Nouveau. Works. I'm having, however, bigger problems properly porting the unit tests and have seen various explosions. In the process I noticed that some things in the unit tests aren't right and a bit of a larger rework will be necessary (for example, the timedout job callback must signal the timedout fence, remove it from the list and so on). Anyways. Please comment on the general idea. @Tvrtko: As briefly brainstormed about on IRC, if you'd be willing to take care of the unit tests patch, I could remove that one (and, maaaaybe, the warning print patch) from the series and we could merge this RFC's successor version %N once it's ready. What do you think? P. [1] https://lore.kernel.org/dri-devel/20250522082742.148191-2-phasta@kernel.org/ [2] https://lore.kernel.org/dri-devel/20250418113211.69956-1-tvrtko.ursulin@igalia.com/ Philipp Stanner (6): drm/sched: Avoid memory leaks with cancel_job() callback drm/sched/tests: Implement cancel_job() drm/sched: Warn if pending list is not empty drm/nouveau: Make fence container helper usable driver-wide drm/nouveau: Add new callback for scheduler teardown drm/nouveau: Remove waitque for sched teardown drivers/gpu/drm/nouveau/nouveau_fence.c | 35 +++++---- drivers/gpu/drm/nouveau/nouveau_fence.h | 7 ++ drivers/gpu/drm/nouveau/nouveau_sched.c | 35 +++++---- drivers/gpu/drm/nouveau/nouveau_sched.h | 9 +-- drivers/gpu/drm/nouveau/nouveau_uvmm.c | 8 +-- drivers/gpu/drm/scheduler/sched_main.c | 37 ++++++---- .../gpu/drm/scheduler/tests/mock_scheduler.c | 71 +++++++------------ drivers/gpu/drm/scheduler/tests/sched_tests.h | 4 +- include/drm/gpu_scheduler.h | 9 +++ 9 files changed, 115 insertions(+), 100 deletions(-) -- 2.49.0