summaryrefslogtreecommitdiffstats
path: root/kernel/gsp_sema_service.c
diff options
context:
space:
mode:
authorArthur Hanson Rasmusson <arthur@vgpu.io>2026-09-29 16:41:48 -0400
committerArthur Hanson Rasmusson <arthur@vgpu.io>2026-09-29 16:41:48 -0400
commitfa6441ae7818e1f47880493eaed10172f9120e53 (patch)
treecb5f959c8fc66f3d14767358c45e08b530c40b51 /kernel/gsp_sema_service.c
parent4a4742f62475a2be9c0dc0f2c2a5d864c686f5f0 (diff)
downloadopen-iov-fa6441ae7818e1f47880493eaed10172f9120e53.tar.gz
open-iov-fa6441ae7818e1f47880493eaed10172f9120e53.zip
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.
Diffstat (limited to 'kernel/gsp_sema_service.c')
-rw-r--r--kernel/gsp_sema_service.c9
1 files changed, 9 insertions, 0 deletions
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;
}