From: Oleg Nesterov <[email protected]>
To: Jens Axboe <[email protected]>
Cc: [email protected], [email protected],
[email protected], [email protected]
Subject: Re: [PATCH 2/6] kernel: add task_sigpending() helper
Date: Thu, 8 Oct 2020 14:58:32 +0200 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
On 10/05, Jens Axboe wrote:
>
> static inline int signal_pending_state(long state, struct task_struct *p)
> {
> if (!(state & (TASK_INTERRUPTIBLE | TASK_WAKEKILL)))
> return 0;
> - if (!signal_pending(p))
> + if (!task_sigpending(p))
> return 0;
This looks obviously wrong. Say, schedule() in TASK_INTERRUPTIBLE should
not block if TIF_NOTIFY_SIGNAL is set.
With this change set_notify_signal() will not force the task to return
from wait_event_interruptible, mutex_lock_interruptible, etc.
> return (state & TASK_INTERRUPTIBLE) || __fatal_signal_pending(p);
> @@ -389,7 +394,7 @@ static inline bool fault_signal_pending(vm_fault_t fault_flags,
> {
> return unlikely((fault_flags & VM_FAULT_RETRY) &&
> (fatal_signal_pending(current) ||
> - (user_mode(regs) && signal_pending(current))));
> + (user_mode(regs) && task_sigpending(current))));
This looks unnecessary,
> @@ -773,7 +773,7 @@ static int ptrace_peek_siginfo(struct task_struct *child,
> data += sizeof(siginfo_t);
> i++;
>
> - if (signal_pending(current))
> + if (task_sigpending(current))
This too.
IMO, this patch should do s/signal_pending/task_sigpending/ only if it is
strictly needed for correctness.
Oleg.
next prev parent reply other threads:[~2020-10-08 12:58 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-10-05 15:04 [PATCHSET RFC v3 0/6] Add support for TIF_NOTIFY_SIGNAL Jens Axboe
2020-10-05 15:04 ` [PATCH 1/6] tracehook: clear TIF_NOTIFY_RESUME in tracehook_notify_resume() Jens Axboe
2020-10-08 12:37 ` Oleg Nesterov
2020-10-08 13:36 ` Jens Axboe
2020-10-05 15:04 ` [PATCH 2/6] kernel: add task_sigpending() helper Jens Axboe
2020-10-08 12:58 ` Oleg Nesterov [this message]
2020-10-08 13:36 ` Jens Axboe
2020-10-08 13:24 ` Oleg Nesterov
2020-10-08 13:38 ` Jens Axboe
2020-10-05 15:04 ` [PATCH 3/6] kernel: split syscall restart from signal handling Jens Axboe
2020-10-08 14:21 ` Oleg Nesterov
2020-10-08 14:31 ` Jens Axboe
2020-10-08 14:41 ` Jens Axboe
2020-10-08 14:45 ` Oleg Nesterov
2020-10-08 14:47 ` Jens Axboe
2020-10-05 15:04 ` [PATCH 4/6] kernel: add support for TIF_NOTIFY_SIGNAL Jens Axboe
2020-10-08 13:53 ` Oleg Nesterov
2020-10-08 14:07 ` Jens Axboe
2020-10-08 14:27 ` Oleg Nesterov
2020-10-05 15:04 ` [PATCH 5/6] x86: define _TIF_NOTIFY_SIGNAL Jens Axboe
2020-10-05 15:04 ` [PATCH 6/6] task_work: use TIF_NOTIFY_SIGNAL if available Jens Axboe
2020-10-08 14:56 ` [PATCHSET RFC v3 0/6] Add support for TIF_NOTIFY_SIGNAL Oleg Nesterov
2020-10-08 15:00 ` Jens Axboe
2020-10-09 8:01 ` Miroslav Benes
2020-10-09 15:21 ` Jens Axboe
2020-10-10 16:53 ` Jens Axboe
2020-10-12 17:27 ` Miroslav Benes
2020-10-13 19:39 ` Jens Axboe
2020-10-13 23:34 ` Thomas Gleixner
2020-10-13 23:37 ` 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