mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bradley Morgan <bradley.morgan@linux.dev>
To: oleg@redhat.com
Cc: akpm@linux-foundation.org, brauner@kernel.org,
	ebiederm@xmission.com, linux-kernel@vger.kernel.org,
	thnkslprpt@gmail.com
Subject: Re: [PATCH 2/2] signal: explain the still_pending check in dequeue_synchronous_signal()
Date: Sun, 29 Nov 2026 22:16:13 +0000	[thread overview]
Message-ID: <053C6FCD-C496-4EAE-BED3-E4E4FD7FD91B@linux.dev> (raw)
In-Reply-To: <aww4EJVsvlUvzot7@redhat.com>

On 29 November 2026 14:34:56 GMT, Oleg Nesterov <oleg@redhat.com> 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@redhat.com>
>---
> 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@linux.dev>

Thanks.

> 	list_for_each_entry_continue(q, &pending->list, list) {
> 		if (q->info.si_signo == sync->info.si_signo)
>

--- Thanks!

  reply	other threads:[~2026-11-29 22:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-29 14:34 [PATCH 1/2] signal: fix/simplify .si_signo checks " Oleg Nesterov
2026-11-29 14:34 ` [PATCH 2/2] signal: explain the still_pending check " Oleg Nesterov
2026-11-29 22:16   ` Bradley Morgan [this message]
2026-11-29 22:15 ` [PATCH 1/2] signal: fix/simplify .si_signo checks " Bradley Morgan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=053C6FCD-C496-4EAE-BED3-E4E4FD7FD91B@linux.dev \
    --to=bradley.morgan@linux.dev \
    --cc=akpm@linux-foundation.org \
    --cc=brauner@kernel.org \
    --cc=ebiederm@xmission.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg@redhat.com \
    --cc=thnkslprpt@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®