Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (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 8FB79606A322 for ; Fri, 4 Dec 2026 07:05:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key, unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=buRcV+Ax Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 04A51112BDA; Fri, 4 Dec 2026 07:05:16 +0000 (UTC) Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5A9F4112CCE for ; Fri, 4 Dec 2026 07:05:10 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id B8CED6191F; Fri, 4 Dec 2026 07:05:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 54FCF1F00897; Fri, 4 Dec 2026 07:05:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796367909; bh=NFDkpZWBQbsMivRTbg936dzOjNtM+s6rz2XpfXsoESo=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=buRcV+AxwH9t4p2sFzXoSU4QZWYgdpDQvfAE9hZY5EgJ5aKh5W+Q3qa6D28XjCC1q Tt1jJP+Q+zCf1HOL0gEkEuc2Qoi1uu2IEr6hMzvExbbXpGhM1HGMh/yLN7MMboPxfu XoeRQ/zwph0k/n4LKXE3T6baTYpYarwQoPumFeD1nBlTKdJENLPi5orlioZQeqmmEz nHe0mSmMJ7/Q+sizJS8DeCGfSLViN5odb/ACvaGfSrLjORgLcfWHe9+vJ4n5dqw27L wrG+h/DtRWvAaDo6j6NdgfMT7NTiwmWkwBgWU4tCVX2YbIQTv8GqimbwxMj3U1XutK wvNxvkvKFAPNw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH v2 1/4] accel/rocket: Wait for in-flight jobs before releasing the file's BOs To: "Arun Iyengar" Cc: dri-devel@lists.freedesktop.org, media-ci@linuxtv.org In-Reply-To: <20261204-rocket-fixes-v2-1-e9f9bb6f1304@gmail.com> References: <20261204-rocket-fixes-v2-0-e9f9bb6f1304@gmail.com> <20261204-rocket-fixes-v2-1-e9f9bb6f1304@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Fri, 04 Dec 2026 07:05:08 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sashiko-reviews@lists.linux.dev Sender: "dri-devel" X-Spam-Status: No, score=-11.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 X-Archived-By: Thank you for your contribution! Sashiko AI review found 2 potential issues to consider: - [Medium] accel/rocket: rocket_job_close() stalls on killed jobs and external fences - [Medium] accel/rocket: rocket_job_close() uninterruptible wait can hang on unbind -- commit 7ea18d68a1c152e194461eacbc0e694b3f497db9 Author: Arun Iyengar accel/rocket: Wait for in-flight jobs before releasing the file's BOs This commit moves rocket_job_close() from rocket_postclose() into a custom release file operation so the scheduler entity is torn down before drm_release() drops GEM handles. It also records the last pushed job's finished fence in rocket_file_priv and waits on it in rocket_job_close(). [ ... ] > diff --git a/drivers/accel/rocket/rocket_job.c b/drivers/accel/rocket/roc= ket_job.c > index 454d465a39e37..32926afb0144c 100644 > --- a/drivers/accel/rocket/rocket_job.c > +++ b/drivers/accel/rocket/rocket_job.c [ ... ] > @@ -246,6 +247,9 @@ static int rocket_job_push(struct rocket_job *job) > =20 > kref_get(&job->refcount); /* put by scheduler job completion */ > =20 > + dma_fence_put(file_priv->last_job_fence); > + file_priv->last_job_fence =3D dma_fence_get(job->inference_done_fence); > + > drm_sched_entity_push_job(&job->base); > } [Severity: Medium] Can storing every pushed job's finished fence in file_priv->last_job_fence cause rocket_job_close() to stall on killed queued jobs and external fences? When a process with queued jobs closes the fd or is killed, drm_sched_entity_kill() chains every unexecuted job one by one through system_wq. In drm_sched_entity_kill_jobs_work(), each killed job also waits on all job->dependencies before signaling s_fence->finished. Because rocket_job_close() waits uninterruptibly on last_job_fence, teardown blocks until those never-executed jobs drain and any external dma_resv fences on PRIME-shared BOs signal. Updating last_job_fence only for jobs scheduled in rocket_job_run() would avoid this stall. [ ... ] > @@ -585,6 +589,12 @@ void rocket_job_close(struct rocket_file_priv *rocke= t_priv) > struct drm_sched_entity *entity =3D &rocket_priv->sched_entity; > =20 > drm_sched_entity_destroy(entity); > + > + if (rocket_priv->last_job_fence) { > + dma_fence_wait(rocket_priv->last_job_fence, false); > + dma_fence_put(rocket_priv->last_job_fence); > + } > + > kfree(rocket_priv->scheds); > } [Severity: Medium] Does this uninterruptible dma_fence_wait() hang forever if a core is unbound while a hung job is in flight? rocket_remove() -> rocket_core_fini() -> rocket_job_fini() calls drm_sched_fini() without a .cancel_job callback or core reset. drm_sched_fini() cancels work_tdr while leaving the in-flight job's s_fence->finished unsignaled, so a later close blocks permanently here. Commit "accel/rocket: Reset the core at unbind" does not fully close this race: a concurrent rocket_job_timedout() -> rocket_reset() can clear core->reset.pending and restart work_run_job without ordering against core->removing, letting rocket_job_run() submit a job before unbind. In that case rocket_reset_work() returns early and drm_sched_fini() still cancels work_tdr with the job in flight. That commit also calls drm_sched_fini() without draining work_free_job or implementing .cancel_job, leaking pending rocket_job objects and their references. --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261204-rocket-fix= es-v2-0-e9f9bb6f1304@gmail.com?part=3D1