diff options
| -rw-r--r-- | kernel/gsp_sema_service.c | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/kernel/gsp_sema_service.c b/kernel/gsp_sema_service.c index 86cee81..ac2e561 100644 --- a/kernel/gsp_sema_service.c +++ b/kernel/gsp_sema_service.c @@ -10398,6 +10398,38 @@ static void svc_pump_channels(struct nv_vgpu_device *vgpu) bitmap_zero(ch->slot_done_epoch, SVC_GPFIFO_MAX_BITS); ch->put_prev = put; + /* + * m136 (SA-STALL M2): liveness watchdog for a held CE entry. + * When this channel's entry loop is not re-entered (early + * continue paths above, or no fresh pushes), a deferred entry + * past the grace window holds the client's tracking-semaphore + * release forever - the guest cudaMalloc stall class. Bound + * every wait here, mirroring the in-loop expiry at :11283: + * verify the exact slot, re-seed and author the fake release + * when it still lags, mark the slot consumed and move on. + */ + if (ch->engine_type && ch->defer_since && ch->entry_want && + time_after_eq(jiffies, ch->defer_since + + msecs_to_jiffies(gsp_sema_ce_grace_ms))) { + if (!svc_entry_want_reached(vgpu, ch)) { + pr_info_ratelimited("sema-chan: watchdog re-seed h=0x%x rank=%u want=%u expected=%u (slot lags)\n", + ch->h_object, ch->ce_index, + ch->entry_want, + ch->expected_sem_payload); + ch->expected_sem_payload = ch->entry_want; + if (!svc_fake_release(vgpu, ch)) + svc.gpfifo_starved++; + } + ch->rescue_fail = 0; + ch->defer_since = 0; + ch->unread_va = 0; + ch->unread_until = 0; + svc_replay_note(ch, (u32)ch->last_get, put); + ch->last_get = (ch->last_get + 1) % + ch->gpfifo_entries; + svc.gpfifo_skipped++; + } + get_before = ch->last_get; applied_before = svc.releases_applied; |
