From: Jan Kiszka <[email protected]>

This fixes the issue of spurious syscall-restart detection in
clock_nanosleep and select when a signal was delivered. In that case,
Linux replaces the ESYSRESTART with EINTR and does not perform any
restart attempt. As a signal delivery implies migration, clearing
XNSYSRST in the migration path resolves the issue.

Fixes: 36132cdb21cd ("cobalt/kernel: Allow to restart clock_nanosleep and 
select after signal processing")
Signed-off-by: Jan Kiszka <[email protected]>
---
 kernel/cobalt/thread.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/kernel/cobalt/thread.c b/kernel/cobalt/thread.c
index eacdd9a089..666b4d4ca0 100644
--- a/kernel/cobalt/thread.c
+++ b/kernel/cobalt/thread.c
@@ -2171,6 +2171,11 @@ void xnthread_relax(int notify, int reason)
                set_cpus_allowed_ptr(p, cpumask_of(cpu));
        }
 #endif
+       /*
+        * After migration there will be no syscall restart (rather a signal
+        * delivery).
+        */
+       xnthread_clear_localinfo(thread, XNSYSRST);
 
        ipipe_clear_thread_flag(TIP_MAYDAY);
 
-- 
2.16.4


Reply via email to