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 67D08C7EE30 for ; Tue, 1 Jul 2025 13:22:24 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1BB4110E5A3; Tue, 1 Jul 2025 13:22:24 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="f9MBxLw+"; dkim-atps=neutral Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by gabe.freedesktop.org (Postfix) with ESMTPS id 2E5F610E286; Tue, 1 Jul 2025 13:22:23 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id F2B42A52FCF; Tue, 1 Jul 2025 13:22:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6047CC4CEEB; Tue, 1 Jul 2025 13:22:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1751376141; bh=whKGu+ajEl81bP78bhCwKxoEBbt3SnanKihrJ68af28=; h=From:To:Cc:Subject:Date:From; b=f9MBxLw+WmrIjPXSZE8GyJti6//XFK/lTygH82PpOqzF7Q2mA+9pwfjjGNVYr5gVG 1/X3jl2RaiUAg52bMKpKEq93yPaCtzNa6kXEHmFBBJcT16BmAUxGiIFLv6jMObCwjp VWLvVopZv+5zIRGDCXecaMrkUzJRXWxnxxEP5HQSGbFAziix4xDar445txDM1zgmq9 FmWG50Hx4/JS/DaMbargGwcFp7MEy1cuT3fNP/2NA6DnCFHcp83FE2rr5iwmkJvAPE 51rJK6Frl05aLeM6S+TqO2rZRIbGwvPsRkujicUu/wqIL8AmEo0ekGCBwCiaXg8Klz NDx64lkwoPzNQ== 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, linaro-mm-sig@lists.linaro.org Subject: [PATCH 0/6] drm/sched: Fix memory leaks with cancel_job() callback Date: Tue, 1 Jul 2025 15:21:38 +0200 Message-ID: <20250701132142.76899-3-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" Changes since the RFC: - Rename helper function for drm_sched_fini(). (Tvrtko) - Add Link to Tvrtko's RFC patch to patch 1. Since a long time, drm_sched_fini() can leak jobs that are still in drm_sched.pending_list. This series solves the leaks in a backwards-compatible manner by adding a new, optional callback. If that callback is implemented, the scheduler uses it to cancel all jobs from pending_list and then frees them. Philipp Stanner (6): drm/sched: Avoid memory leaks with cancel_job() callback drm/sched/tests: Port to 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 | 66 +++++++------------ include/drm/gpu_scheduler.h | 18 +++++ 8 files changed, 122 insertions(+), 93 deletions(-) -- 2.49.0