From: Oleg Nesterov <oleg@redhat.com>
To: Andrea Calabrese <andrea.calabrese@amarulasolutions.com>
Cc: brauner@kernel.org, akpm@linux-foundation.org,
peterz@infradead.org, tglx@kernel.org, kexinsun@smail.nju.edu.cn,
adrianhuang0701@gmail.com, elver@google.com,
linux-kernel@vger.kernel.org, linux-amarula@amarulasolutions.com
Subject: Re: [PATCH] kernel: refactor: shorten has_pending_signals
Date: Tue, 19 May 2026 17:05:48 +0200 [thread overview]
Message-ID: <agx8TP9TXXnPBiBF@redhat.com> (raw)
In-Reply-To: <20260519103316.122139-3-andrea.calabrese@amarulasolutions.com>
Hi Andrea,
thanks, but perhaps you can cleanup the changelog?
On 05/19, Andrea Calabrese wrote:
>
> In has_pending_signals there was a switch/case pattern that did not need
> to be there, as the default for loop also covers those cases.
Yes, but this code is very, very old. I agree, this optimization makes no
sense with the modern compilers, but your description doesn't look accurate.
The switch/case code was added on purpose, even if the default loop covers
those cases.
> This patch does not change the binary output of the file
> kernel/signal.o.
I guess you tested x86. Good.
> A diff between the files gives shows (old -> new):
> 2072c2072
> < case 1: ready = signal->sig[0] &~ blocked->sig[0];
> ---
> > ready |= signal->sig[i] & ~blocked->sig[i];
> 2149c2149
> < case 1: ready = signal->sig[0] &~ blocked->sig[0];
> ---
> > ready |= signal->sig[i] & ~blocked->sig[i];
> 2155c2155
> < case 1: ready = signal->sig[0] &~ blocked->sig[0];
> ---
> > ready |= signal->sig[i] & ~blocked->sig[i];
> 9799c9799
> < case 1: ready = signal->sig[0] &~ blocked->sig[0];
> ---
> > ready |= signal->sig[i] & ~blocked->sig[i];
> 9805c9805
> < case 1: ready = signal->sig[0] &~ blocked->sig[0];
> ---
> > ready |= signal->sig[i] & ~blocked->sig[i];
I don't understand this part of your changelog, but I think it should
be removed anyway ;)
Oleg.
prev parent reply other threads:[~2026-05-19 15:06 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-19 10:33 [PATCH] kernel: refactor: shorten has_pending_signals Andrea Calabrese
2026-05-19 15:05 ` Oleg Nesterov [this message]
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=agx8TP9TXXnPBiBF@redhat.com \
--to=oleg@redhat.com \
--cc=adrianhuang0701@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=andrea.calabrese@amarulasolutions.com \
--cc=brauner@kernel.org \
--cc=elver@google.com \
--cc=kexinsun@smail.nju.edu.cn \
--cc=linux-amarula@amarulasolutions.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@kernel.org \
/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