diff options
author | Eric W. Biederman <ebiederm@xmission.com> | 2018-07-20 12:31:53 +0200 |
---|---|---|
committer | Eric W. Biederman <ebiederm@xmission.com> | 2018-09-11 21:19:22 +0200 |
commit | 035150540545f62bada95860ba00fe1e0cd62f63 (patch) | |
tree | 5831b9b102dd240cf74654c978118c4d1d432f2c /kernel/signal.c | |
parent | signal: Remove the siginfo paramater from kernel_dqueue_signal (diff) | |
download | linux-035150540545f62bada95860ba00fe1e0cd62f63.tar.xz linux-035150540545f62bada95860ba00fe1e0cd62f63.zip |
signal: Don't send siginfo to kthreads.
Today kernel threads never dequeue siginfo so it is pointless to
enqueue siginfo for them. The usb gadget mass storage driver goes
one farther and uses SEND_SIG_FORCED to guarantee that no siginfo is
even enqueued.
Generalize the optimization of the usb mass storage driver and never
perform an unnecessary allocation when delivering signals to kthreads.
Switch the mass storage driver from sending signals with
SEND_SIG_FORCED to SEND_SIG_PRIV. As using SEND_SIG_FORCED is now
unnecessary.
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Diffstat (limited to 'kernel/signal.c')
-rw-r--r-- | kernel/signal.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/signal.c b/kernel/signal.c index 8081ab79e97d..20931a892ace 100644 --- a/kernel/signal.c +++ b/kernel/signal.c @@ -1057,7 +1057,7 @@ static int __send_signal(int sig, struct siginfo *info, struct task_struct *t, * fast-pathed signals for kernel-internal things like SIGSTOP * or SIGKILL. */ - if (info == SEND_SIG_FORCED) + if ((info == SEND_SIG_FORCED) || (t->flags & PF_KTHREAD)) goto out_set; /* |