From fa6441ae7818e1f47880493eaed10172f9120e53 Mon Sep 17 00:00:00 2001 From: Arthur Hanson Rasmusson Date: Tue, 29 Sep 2026 16:41:48 -0400 Subject: sema-svc: wake the service thread on every injected pin The injection queue was only drained at the top of the service loop, which can be inside a multi-second pump/discovery pass; live runs showed the GR counter pins landing ~1 s after the client mapped the page, i.e. after its context-init deadline. Waking on enqueue drains the batch immediately. --- kernel/gsp_sema_service.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/kernel/gsp_sema_service.c b/kernel/gsp_sema_service.c index d476188..3c732e8 100644 --- a/kernel/gsp_sema_service.c +++ b/kernel/gsp_sema_service.c @@ -4870,6 +4870,15 @@ int gsp_sema_service_add_map(u64 gpu_va, u64 pa, u64 len, u32 ap) svc_map_add_q[svc_map_add_head % SVC_MAP_ADD_MAX].ap = ap; svc_map_add_head = next; spin_unlock_irqrestore(&svc_map_add_lock, flags); + + /* + * Drain now: the client's context-init deadline is a couple of + * seconds and the service loop may be in a long pump/discovery pass, + * so an injection that waits for the next loop iteration can land + * after the client already gave up. + */ + if (svc.task) + wake_up_process(svc.task); return 0; } -- cgit v1.2.3