From 0df1b9e72aa55d49caee303a75c2dc14c4c59e59 Mon Sep 17 00:00:00 2001 From: Arthur Hanson Rasmusson Date: Fri, 9 Oct 2026 13:22:14 -0400 Subject: vgsp-sema: per-session entry-outcome and stream probes for the CE->GR transition (ISSUE-0002) r31 experiment: log every CE GPFIFO entry read (budget raised, reset per session), every svc_decode_stream call, and the two exits that consume an entry without a decoded release (norel hold / unread slow path). Names the exact exit taken by the second session's follow-up pushes. --- kernel/gsp_sema_service.c | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) (limited to 'kernel') diff --git a/kernel/gsp_sema_service.c b/kernel/gsp_sema_service.c index e297887..7ab82ba 100644 --- a/kernel/gsp_sema_service.c +++ b/kernel/gsp_sema_service.c @@ -5621,7 +5621,7 @@ static void svc_decode_stream(struct nv_vgpu_device *vgpu, const u8 *buf, ch->h_object, ch->engine_type, push_va, len, allow_ops, trusted); } - if (gsp_sema_dbg && ch->engine_type && svc_dbg_streams < 24) { + if (gsp_sema_dbg && ch->engine_type && svc_dbg_streams < 96) { svc_dbg_streams++; pr_info("sema-dbg: stream h=0x%x eng=%u va=0x%llx len=%u allow=%d w=%08x %08x %08x %08x %08x %08x %08x %08x\n", ch->h_object, ch->engine_type, push_va, len, allow_ops, @@ -6703,6 +6703,14 @@ static void svc_session_flush(void) */ svc.entry_log = 0; svc_pushalt_log = 0; + /* + * Per-entry/stream decode diagnostics are per-session: the first + * client otherwise spends them and the second client's CE->GR + * transition is invisible (r24-r30: c2's follow-up pushes never + * surfaced). + */ + svc.gpfifo_entry_log = 0; + svc_dbg_streams = 0; memset(svc_hot, 0, sizeof(svc_hot)); memset(svc_retry_q, 0, sizeof(svc_retry_q)); memset(svc_pool_pa, 0, sizeof(svc_pool_pa)); @@ -11973,6 +11981,23 @@ static bool svc_push_read_displaced(struct nv_vgpu_device *vgpu, u32 h, return true; } +/* + * Per-entry outcome probe (ISSUE-0002, r31+): names the exit the pump takes + * for a CE entry when no release was applied. Shared per-session budget with + * the entry-read log (svc.gpfifo_entry_log, reset by the session flush) so + * the read lines and their outcomes interleave in order. + */ +static void svc_entry_outcome(const char *what, const struct svc_channel *ch, + u64 idx, u64 va, u32 len) +{ + if (!gsp_sema_dbg || !ch->engine_type || svc.gpfifo_entry_log >= 512) + return; + svc.gpfifo_entry_log++; + pr_info("sema-entry: %s h=0x%x idx=%llu va=0x%llx len=%u want=%u exp=%u unread=%d\n", + what, ch->h_object, idx, va, len, ch->entry_want, + ch->expected_sem_payload, ch->unread_until ? 1 : 0); +} + static void svc_pump_channels(struct nv_vgpu_device *vgpu) { /* Only ever called from the service thread. */ @@ -12313,7 +12338,7 @@ static void svc_pump_channels(struct nv_vgpu_device *vgpu) entry_done = ch->slot_ops_done[idx]; } - if (gsp_sema_dbg && svc.gpfifo_entry_log < 160) { + if (gsp_sema_dbg && svc.gpfifo_entry_log < 512) { pr_info("sema-chan: entry[%llu] h=0x%x eng=%u raw=%08x%08x va=0x%llx len=%u\n", idx, ch->h_object, ch->engine_type, e1, e0, va, len); @@ -12549,6 +12574,8 @@ static void svc_pump_channels(struct nv_vgpu_device *vgpu) u32 rel_n_before = svc_rel_count; bool rel_seen; + svc_entry_outcome("decode", ch, + idx, va, len); svc.op_tr_pending = 0; svc_decode_stream(vgpu, pb, len, 0, @@ -12735,6 +12762,10 @@ static void svc_pump_channels(struct nv_vgpu_device *vgpu) ch->expected_sem_payload) { u32 rel_n2 = svc_rel_count; + svc_entry_outcome("norel", + ch, idx, + va, len); + /* * Open the cheap-wait window * for this entry (see the @@ -12888,6 +12919,8 @@ static void svc_pump_channels(struct nv_vgpu_device *vgpu) * channel's next expected payload, and pin * its whole slot. */ + svc_entry_outcome("unread", ch, + idx, va, len); svc_log_stalled_va(va); /* * Open the cheap-wait window -- cgit v1.2.3