From b7636afd9715748396325ec4dd0899c7f42ece17 Mon Sep 17 00:00:00 2001 From: Arthur Hanson Rasmusson Date: Tue, 29 Sep 2026 15:34:18 -0400 Subject: sema-svc: apply releases before push memsets; poller: bypass read cache --- kernel/gsp_sema_service.c | 39 ++++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) (limited to 'kernel') diff --git a/kernel/gsp_sema_service.c b/kernel/gsp_sema_service.c index a04a3c2..0c0e85b 100644 --- a/kernel/gsp_sema_service.c +++ b/kernel/gsp_sema_service.c @@ -2505,6 +2505,32 @@ static void svc_decode_stream(struct nv_vgpu_device *vgpu, const u8 *buf, pending = 1; } + /* + * Apply the release BEFORE running the push's + * collected work. The client's tracker only + * observes the release, and its context-init + * deadline is what the whole run races against; + * running the memsets first added their full + * execution time to every push's visible + * completion latency. Ordering is still safe: + * this is the only writer of both the semaphore + * and the vidmem shadow, and the next push is + * not decoded until this call returns. + */ + if (pending) { + svc.pushes_pending++; + if (DMA_SEM_REDUCTION_EN(dma) && + DMA_SEM_REDUCTION(dma) == + SEM_REDUCTION_INC) + cur += st.sem_payload; + else + cur = st.sem_payload; + if (!svc_sem_write(vgpu, sem_va, cur)) { + svc.releases_applied++; + svc.post_hint_until = jiffies + 10 * HZ; + } + } + /* * The push's collected work always runs on real * hardware; the release only orders observers. @@ -2521,19 +2547,6 @@ static void svc_decode_stream(struct nv_vgpu_device *vgpu, const u8 *buf, svc.ring_ops++; ops_runs++; } - if (pending) { - svc.pushes_pending++; - if (DMA_SEM_REDUCTION_EN(dma) && - DMA_SEM_REDUCTION(dma) == - SEM_REDUCTION_INC) - cur += st.sem_payload; - else - cur = st.sem_payload; - if (!svc_sem_write(vgpu, sem_va, cur)) { - svc.releases_applied++; - svc.post_hint_until = jiffies + 10 * HZ; - } - } /* * Exact-slot fallback: the releasing channel's -- cgit v1.2.3