diff options
Diffstat (limited to 'kernel/gsp_sema_service.c')
| -rw-r--r-- | kernel/gsp_sema_service.c | 73 |
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++; |
