Skip to contentSkip to conversation

evl/thread: fix lost kick of a thread running on a remote CPU

PATCH Applied Tobias Schaffner 2 participants 2 messages Nov 10 – Nov 11

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 evl/thread: fix lost kick of a thread running on a remote CPU

evl_kick_thread() skips the mayday if the kicked thread is current on its own runqueue instead of the local one. A thread running out-of-band on another CPU is therefore never kicked and keeps running with a pending signal.

Check against the local runqueue again.

Fixes fecf5883ecd3 ("evl/sched: get rid of this_evl_rq_thread()")
---
 kernel/evl/thread.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/evl/thread.c +1 -1
index 2aa07b494d40..94d073a1b7e7 100644
@@ -1323,7 +1323,7 @@ void evl_kick_thread(struct evl_thread *thread)
 	 * stage demotion took place.
 	 */
 	if (thread->state & EVL_T_USER) {
-		if (rq->curr != thread)
+		if (this_evl_rq()->curr != thread)
 			dovetail_send_mayday(p);
 
 		if (thread->state & EVL_THREAD_LAZY_MASK)

base-commit: a3ad77d7ba3eac8a73f64026272747c01dd84fc6

Signature · 1 line
2.53.0
#1 lore raw
Quoted 27 lines · Tobias Schaffner

evl_kick_thread() skips the mayday if the kicked thread is current on its own runqueue instead of the local one. A thread running out-of-band on another CPU is therefore never kicked and keeps running with a pending signal.

Check against the local runqueue again.

Fixes fecf5883ecd3 ("evl/sched: get rid of this_evl_rq_thread()")
---
 kernel/evl/thread.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/evl/thread.c +1 -1
index 2aa07b494d40..94d073a1b7e7 100644
@@ -1323,7 +1323,7 @@ void evl_kick_thread(struct evl_thread *thread)
 	 * stage demotion took place.
 	 */
 	if (thread->state & EVL_T_USER) {
-		if (rq->curr != thread)
+		if (this_evl_rq()->curr != thread)
 			dovetail_send_mayday(p);
 
 		if (thread->state & EVL_THREAD_LAZY_MASK)
Quoted 1 line

base-commit: a3ad77d7ba3eac8a73f64026272747c01dd84fc6

Merged, thanks (upstreaming soon).

Signature · 1 line
Philippe.