lkml.org 
[lkml]   [2020]   [Oct]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 2/6] kernel: add task_sigpending() helper
    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.

    \
     
     \ /
      Last update: 2020-10-08 15:01    [W:2.461 / U:0.152 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site