From: Javier MV <javiermv@gmail.com>
To: intel-gfx@lists.freedesktop.org
Cc: Javier MV <javiermv@duck.com>,
jani.nikula@linux.intel.com, joonas.lahtinen@linux.intel.com,
rodrigo.vivi@intel.com, tursulin@ursulin.net,
matthew.brost@intel.com, daniele.ceraolospurio@intel.com,
umesh.nerlige.ramappa@intel.com
Subject: [PATCH 0/2] drm/i915/guc: Fix requests of a banned context never completing
Date: Tue, 10 Nov 2026 12:24:46 +0000 [thread overview]
Message-ID: <20261110122534.12989-1-javiermv@gmail.com> (raw)
From: Javier MV <javiermv@duck.com>
On ADL-P with GuC submission, a GuC context reset of a context whose requests
are being cancelled by the request watchdog can leave that context's requests
incomplete forever. The client waits on their fences forever, and if it is
killed its buffers stay pinned until reboot (here 7.5 GB of Shmem/Unevictable,
with the process gone from DRM clients).
Reported in https://gitlab.freedesktop.org/drm/i915/kernel/-/issues/15301.
The sequence, from instrumented runs (a llama.cpp Vulkan compute job,
request_timeout_ms=2000 via debugfs, preempt_timeout_ms=7500):
1. The watchdog cancels a request: guc_context_cancel_request() blocks the
context (schedule disable) to skip it.
2. GuC can't preempt the compute work (no mid-thread preemption on Gen12) and
resets the context instead. The reset handler captures, bans (revoke finds
the disable pending, so it only sets a 1 ms preemption timeout) and replays,
which unwinds the incomplete requests back to the scheduler queue.
3. The late schedule disable done G2H clears SCHED_STATE_BANNED and cancels
nothing (the list is already empty), then guc_context_unblock() enables
scheduling of the banned context.
4. Either the resubmitted requests run as NOPs and everything retires
(harmless), or GuC resets the context again at the first preemption (1 ms
timeout). That second notification is ignored for a banned context, so its
submitted requests never complete. In one run this was followed by G2H
action 0x6000 rejected with -EOPNOTSUPP, a stopped rcs0 heartbeat and a
full GT reset; after it the context was no longer registered, and the
dequeue only marks the last of a banned context's merged requests
complete, so the other 9 never completed.
Patch 1 completes all requests of a non-schedulable context on resubmission
(once it is off the HW), and patch 2 stops unblock from re-enabling a banned
context.
A reset notification for an already banned context is still ignored. I didn't
see one with this series, so it doesn't change that, but if one can still
happen some other way, that context's requests could stay incomplete. I have
an additional patch for that case, which cancels the requests on such a
notification. It has never run in my tests because I couldn't reach that path
with these patches applied, so I left it out, but I can send it if you want it.
Tested on i5-1235U (ADL-P GT2, 8086:46a8), GuC 70.36.0, on top of Ubuntu's
7.0.0-42 (mainline 7.0.14; the touched code is identical in mainline as of
2026-10-29). Without the series: 5 hangs in 17 runs with the setup above
(some with other GPU or CPU load), one of them leaked as described (as did
an earlier run on the stock module). With this series: 30 runs, 1 hang (the
ecode of the run that leaked): no full GT reset, the client got
VK_ERROR_DEVICE_LOST instead of waiting forever, nothing stayed pinned.
Instrumented builds that also carried the additional patch above, which never
fired: 20 runs with both patches, 2 hangs of the leaking kind (same ecodes as
before), handled the same way, and the logs show no second reset; 20 runs with
patch 1 alone, 1 hang, also contained.
I can reproduce this here, though a hang takes 10 to 30 runs. If it helps, I
can send the full log of a hang from the instrumented build, attach error
states, or test a different approach if you'd rather fix it another way.
Tool disclosure: I did this work with Claude Code (Opus 5.5), over several
sessions. I reported the symptoms, ran it on my machine and decided what to
pursue. The assistant read the i915 sources and the logs, wrote the debug
instrumentation and test scripts, worked out the sequence above, and wrote both
patches, their changelogs and most of this letter. The logs and results quoted
here come from runs on my machine. I have checked the sequence and the patches
against the code and can answer for them.
Javier MV (2):
drm/i915/guc: Complete all requests of a non-schedulable context
drm/i915/guc: Don't unblock a banned context
.../gpu/drm/i915/gt/uc/intel_guc_submission.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
base-commit: d89e1d186ec9271bf78e62771779e9fc03bf0fc3
--
2.51.1
next reply other threads:[~2026-11-10 12:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-10 12:24 Javier MV [this message]
2026-11-10 12:24 ` [PATCH 1/2] drm/i915/guc: Complete all requests of a non-schedulable context Javier MV
2026-11-10 12:56 ` sashiko-bot
2026-11-10 12:24 ` [PATCH 2/2] drm/i915/guc: Don't unblock a banned context Javier MV
2026-11-10 13:07 ` sashiko-bot
2026-11-10 15:11 ` ✗ LGCI.VerificationFailed: failure for drm/i915/guc: Fix requests of a banned context never completing Patchwork
2026-11-11 15:29 ` [PATCH 0/2] " Javier MV
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20261110122534.12989-1-javiermv@gmail.com \
--to=javiermv@gmail.com \
--cc=daniele.ceraolospurio@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--cc=javiermv@duck.com \
--cc=joonas.lahtinen@linux.intel.com \
--cc=matthew.brost@intel.com \
--cc=rodrigo.vivi@intel.com \
--cc=tursulin@ursulin.net \
--cc=umesh.nerlige.ramappa@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.