summaryrefslogtreecommitdiffstats
path: root/kernel/gsp_sema_service.c
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-11-06 17:18:24 -0500
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-11-06 17:18:24 -0500
commit3bb62602ae1c8c453f403b2907ba2b3e94f59876 (patch)
tree68460bfb97b9abc986437964106a299f669c55f9 /kernel/gsp_sema_service.c
parentc822fa346e2feb1b9f57160beeffc6f69ab0c923 (diff)
downloadopen-iov-3bb62602ae1c8c453f403b2907ba2b3e94f59876.tar.gz
open-iov-3bb62602ae1c8c453f403b2907ba2b3e94f59876.zip
vgsp-gl: bounded setup-push hold for maturity debugging
sema_gr_setup_hold_ms (default 0, clamp 2000 ms) holds/defer the draw window while the 60216-byte setup push pin is landing, replacing the ~50% IMMATURE-SKIP lottery. Measured: 2000 ms stalls the ring behind the unreadable 0x4021004 entry (8 launches then silence), so the default stays 0; the param is a debug gate only. r1557 with hold=0 produced 64 beef launches and the DS A/B baseline 80000000->a0040a06. Evidence: Handoff cont 8.
Diffstat (limited to 'kernel/gsp_sema_service.c')
-rw-r--r--kernel/gsp_sema_service.c73
1 files changed, 68 insertions, 5 deletions
diff --git a/kernel/gsp_sema_service.c b/kernel/gsp_sema_service.c
index 5348c95..dafbad6 100644
--- a/kernel/gsp_sema_service.c
+++ b/kernel/gsp_sema_service.c
@@ -26481,6 +26481,17 @@ unsigned gsp_sema_push_hold_ms = 2500;
*/
unsigned gsp_sema_gr_setup_hold_ms;
+/*
+ * SESSION 155 CONT 8: per-boot draw-window hold deadline for the same
+ * parameter. While it is open, an immature beef window is busy-deferred
+ * (candidate survives, pump re-offers it) instead of being software-
+ * completed by IMMATURE-SKIP, so the pump keeps walking the held setup-push
+ * entry and a late pin/upload can still mature the capture. Armed once per
+ * module load (= per boot) and bounded by the clamped param (<= 2000 ms).
+ */
+static unsigned long svc_setup_hold_wait_j;
+static bool svc_setup_hold_exp_logged;
+
static unsigned long svc_gr_ring_tried; /* ranks that got a diagnostic line */
/*
@@ -26610,14 +26621,26 @@ static void svc_gr_setup_hold_arm(struct svc_channel *ch, u64 va, u32 idx,
*/
svc_pushfail_log = 0;
svc_pinrej_log = 0;
- if (gsp_sema_gr_setup_hold_ms)
+ /*
+ * SESSION 155 CONT 8: the hold is hard-bounded at 2000 ms.
+ * Longer values (the old r1083-r1087 20 s experiment) block
+ * the whole ring behind the unreadable setup entry and derail
+ * the client; 0 still disables the hold (demand rows remain).
+ */
+ if (gsp_sema_gr_setup_hold_ms) {
+ unsigned hold_ms = min_t(unsigned,
+ READ_ONCE(gsp_sema_gr_setup_hold_ms),
+ 2000u);
+
ch->gr_setup_hold_until = jiffies +
- msecs_to_jiffies(gsp_sema_gr_setup_hold_ms);
- else
+ msecs_to_jiffies(hold_ms);
+ } else {
ch->gr_setup_hold_until = 0;
- pr_info("sema-chan: GR setup hold h=0x%x entry=%u va=0x%llx len=%u armed (demanding 4K pages; hold=%u ms; pending until the pin lands)\n",
+ }
+ pr_info("sema-chan: GR setup hold h=0x%x entry=%u va=0x%llx len=%u armed (demanding 4K pages; hold=%u ms clamped<=2000; pending until the pin lands)\n",
ch->h_object, idx, va, len,
- gsp_sema_gr_setup_hold_ms);
+ ch->gr_setup_hold_until ?
+ jiffies_to_msecs(ch->gr_setup_hold_until - jiffies) : 0u);
}
for (poff = 0; poff < len && poff < 0x40000u; poff += SEMA_PAGE_SIZE) {
svc_log_stalled_va(page + poff);
@@ -36971,6 +36994,46 @@ static bool svc_gr_request(struct nv_vgpu_device *vgpu,
(ch->h_object & 0xfffff000u) == 0xbeef0000u &&
READ_ONCE(svc_mme_prelude_flag) &&
!gsp_sema_mme_prelude_mature()) {
+ unsigned hold_ms =
+ min_t(unsigned, READ_ONCE(gsp_sema_gr_setup_hold_ms),
+ 2000u);
+
+ /*
+ * SESSION 155 CONT 8: bounded setup-push draw-window hold.
+ * Instead of immediately software-completing an immature
+ * beef window, keep the candidate pending (busy-defer, no
+ * bridge fallback) while a per-boot deadline of
+ * sema_gr_setup_hold_ms (clamped <= 2000 ms) is open. The
+ * pump re-offers the window on every pass and keeps walking
+ * the held setup-push entry, so a pin/upload that lands
+ * inside the window matures the capture and the next retry
+ * forwards the client's real window. Past the deadline the
+ * historical IMMATURE-SKIP resumes, one loud receipt.
+ */
+ if (hold_ms && !svc_setup_hold_wait_j)
+ svc_setup_hold_wait_j = jiffies +
+ msecs_to_jiffies(hold_ms);
+ if (hold_ms && time_before(jiffies, svc_setup_hold_wait_j)) {
+ clear_bit_unlock(SVC_FWD_INFLIGHT, &svc_fwd_state);
+ mutex_unlock(&svc_fwd_lock);
+ svc_gr_busy_defer = true;
+ svc.fwd_gr_refused++;
+ svc_gr_prelude_gate_defer++;
+ if (svc_gr_prelude_gate_defer <= 24 ||
+ (svc_gr_prelude_gate_defer & 0xFF) == 1)
+ pr_info("vgsp-work: SETUP-HOLD-DEFER h=0x%x push=0x%llx (MME prelude immature; holding the window for the setup pin, remaining=%u ms) n=%llu\n",
+ ch->h_object, svc_gr_cand.push_va,
+ jiffies_to_msecs(svc_setup_hold_wait_j -
+ jiffies),
+ svc_gr_prelude_gate_defer);
+ return false;
+ }
+ if (hold_ms && !svc_setup_hold_exp_logged) {
+ svc_setup_hold_exp_logged = true;
+ pr_info("vgsp-work: SETUP-HOLD-EXPIRED h=0x%x push=0x%llx (hold=%u ms elapsed, prelude still immature; resuming IMMATURE-SKIP) n=%llu\n",
+ ch->h_object, svc_gr_cand.push_va, hold_ms,
+ svc_gr_prelude_gate_defer);
+ }
clear_bit_unlock(SVC_FWD_INFLIGHT, &svc_fwd_state);
mutex_unlock(&svc_fwd_lock);
svc.fwd_gr_refused++;