Re: [PATCH 2/2] signal: explain the still_pending check in dequeue_synchronous_signal()
From: Bradley Morgan
Date: Sun Nov 29 2026 - 17:16:20 EST
On 29 November 2026 14:34:56 GMT, Oleg Nesterov <oleg@xxxxxxxxxx> wrote:
>The "still_pending" logic in dequeue_synchronous_signal() is actually
>correct, but looks either unnecessary or incomplete: it is not clear how
>we can find another siginfo with the same .si_signo < SIGRTMIN; and if
>this is possible it is not clear why that siginfo can't be queued before
>"sync".
>
>Add a comment to explain both subtleties.
Good.
>
>Signed-off-by: Oleg Nesterov <oleg@xxxxxxxxxx>
>---
> kernel/signal.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
>diff --git a/kernel/signal.c b/kernel/signal.c
>index 482db380a498..e744bd146e80 100644
>--- a/kernel/signal.c
>+++ b/kernel/signal.c
>@@ -695,6 +695,11 @@ static int dequeue_synchronous_signal(kernel_siginfo_t *info)
> next:
> /*
> * Check if there is another siginfo for the same signal.
>+ *
>+ * sync->info.si_signo < SIGRTMIN, but posixtimer_queue_sigqueue()
>+ * bypasses legacy_queue() and adds non-SI_FROMKERNEL SI_TIMER to
>+ * the tail. It can't appear before SI_FROMKERNEL "sync" which had
>+ * to pass legacy_queue() in __send_signal_locked().
> */
I like this.
Reviewed-by: Bradley Morgan <bradley.morgan@xxxxxxxxx>
Thanks.
> list_for_each_entry_continue(q, &pending->list, list) {
> if (q->info.si_signo == sync->info.si_signo)
>
--- Thanks!