do_wait() wakeup optimization: child_wait_callback: check __WNOTHREAD case
Changes
1 files changed · +3 −0
| File | Status | Add | Del | Content |
|---|---|---|---|---|
| kernel/exit.c | modified | +3 | −0 | View file |
kernel/exit.c
View filediff --git a/kernel/exit.c b/kernel/exit.c
index 7838b4d..270a68b 100644
--- a/kernel/exit.c
+++ b/kernel/exit.c
@@ -1581,6 +1581,9 @@ static int child_wait_callback(wait_queue_t *wait, unsigned mode,
if (!eligible_child(wo, p))
return 0;
+ if ((wo->wo_flags & __WNOTHREAD) && wait->private != p->parent)
+ return 0;
+
return default_wake_function(wait, mode, sync, key);
}