From fa31d766d548a0e07426b6d231a42f05c07521a8 Mon Sep 17 00:00:00 2001 From: Arthur Hanson Rasmusson Date: Tue, 29 Sep 2026 14:41:14 -0400 Subject: kernel: grace window for untranslatable GR entries; tools: coalesce window pin output The first GR window pin landed ~2 s after the pump consumed the freshly created channels' GPFIFO entries on the first failed read, so the pushes (and the tracking-semaphore releases they carry) were lost. GR entries with an unresolvable push page now stay pending for sema_gr_grace_ms (default 8 s) before the stale-entry consume; a pin landing in that window makes the entry readable and it executes normally. The completion counter is still published from put at the end of every pass, so the client's counter wait is not delayed. guest_pmap_win.py coalesces contiguous VA+PA pages into run lines, so a 15k-page window transfers as ~200 lines instead of ~15k and the pin batch lands within a second of the pages appearing. --- kernel/main.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'kernel/main.c') diff --git a/kernel/main.c b/kernel/main.c index 726b4bf..952daf1 100644 --- a/kernel/main.c +++ b/kernel/main.c @@ -2440,6 +2440,13 @@ MODULE_PARM_DESC(sema_gr_rings, "Auto-discover+pin GR channel rings (default 1)" module_param_named(sema_fake_rel, gsp_sema_fake_rel, bool, 0644); MODULE_PARM_DESC(sema_fake_rel, "Acknowledge unreadable CE releases directly (default 0)"); +/* + * Grace window (ms) an untranslatable GR entry stays pending before the pump + * consumes it as stale, so a late push-buffer pin can still make it readable. + */ +module_param_named(sema_gr_grace_ms, gsp_sema_gr_grace_ms, uint, 0644); +MODULE_PARM_DESC(sema_gr_grace_ms, "GR pending-entry grace window in ms (default 8000)"); + /* * Debug: inject a verified {GPU VA -> guest PA} translation into the * semaphore service (used when the client's mapping cannot be discovered -- cgit v1.2.3