public inbox for [email protected]
 help / color / mirror / Atom feed
From: Oleg Nesterov <[email protected]>
To: Jens Axboe <[email protected]>
Cc: [email protected], [email protected],
	[email protected], [email protected]
Subject: Re: [PATCH 3/4] kernel: add support for TIF_NOTIFY_SIGNAL
Date: Fri, 9 Oct 2020 16:43:29 +0200	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

Once again, I am fine with this patch, just a minor comment...

On 10/08, Jens Axboe wrote:
>
> --- a/arch/x86/kernel/signal.c
> +++ b/arch/x86/kernel/signal.c
> @@ -808,7 +808,10 @@ void arch_do_signal(struct pt_regs *regs)
>  {
>  	struct ksignal ksig;
>
> -	if (get_signal(&ksig)) {
> +	if (test_thread_flag(TIF_NOTIFY_SIGNAL))
> +		tracehook_notify_signal();
> +
> +	if (task_sigpending(current) && get_signal(&ksig)) {

I suggested to change arch_do_signal() because somehow I like it this way ;)

And because we can easily pass the "ti_work" mask to arch_do_signal() and
avoid test_thread_flag/task_sigpending.

Hmm. I just noticed that only x86 uses arch_do_signal(), so perhaps you can
add this change to this patch right now? Up to you.



On the other hand, we could add

	if (test_thread_flag(TIF_NOTIFY_SIGNAL))
		tracehook_notify_signal();

	if (!task_sigpending(current))
		return 0;

at the start of get_signal() instead. Somehow I don't really like this, but
this way we do need less changes in arch-dependant code. Again, up to you.

Oleg.


  reply	other threads:[~2020-10-09 14:43 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-08 15:27 [PATCHSET v4] Add support for TIF_NOTIFY_SIGNAL Jens Axboe
2020-10-08 15:27 ` [PATCH 1/4] tracehook: clear TIF_NOTIFY_RESUME in tracehook_notify_resume() Jens Axboe
2020-10-13 23:35   ` Thomas Gleixner
2020-10-14  1:13     ` Jens Axboe
2020-10-08 15:27 ` [PATCH 2/4] kernel: add task_sigpending() helper Jens Axboe
2020-10-13 23:36   ` Thomas Gleixner
2020-10-08 15:27 ` [PATCH 3/4] kernel: add support for TIF_NOTIFY_SIGNAL Jens Axboe
2020-10-09 14:43   ` Oleg Nesterov [this message]
2020-10-09 15:13     ` Jens Axboe
2020-10-13 23:45       ` Thomas Gleixner
2020-10-13 23:54         ` Jens Axboe
2020-10-13 23:42   ` Thomas Gleixner
2020-10-13 23:45     ` Jens Axboe
2020-10-08 15:27 ` [PATCH 4/4] task_work: use TIF_NOTIFY_SIGNAL if available Jens Axboe
2020-10-13 23:50   ` Thomas Gleixner
2020-10-13 23:55     ` Jens Axboe
2020-10-09 14:30 ` [PATCHSET v4] Add support for TIF_NOTIFY_SIGNAL Oleg Nesterov
2020-10-09 15:16   ` Jens Axboe

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 \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /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