diff options
author | Tejun Heo <tj@kernel.org> | 2011-11-23 18:28:17 +0100 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2011-11-23 18:28:17 +0100 |
commit | 34b087e48367c252e343c2f8de65676a78af1e4a (patch) | |
tree | fbe94bad0a3073c6f4231752fba99c6bc8702277 /kernel/kthread.c | |
parent | dmatest: don't use set_freezable_with_signal() (diff) | |
download | linux-34b087e48367c252e343c2f8de65676a78af1e4a.tar.xz linux-34b087e48367c252e343c2f8de65676a78af1e4a.zip |
freezer: kill unused set_freezable_with_signal()
There's no in-kernel user of set_freezable_with_signal() left. Mixing
TIF_SIGPENDING with kernel threads can lead to nasty corner cases as
kernel threads never travel signal delivery path on their own.
e.g. the current implementation is buggy in the cancelation path of
__thaw_task(). It calls recalc_sigpending_and_wake() in an attempt to
clear TIF_SIGPENDING but the function never clears it regardless of
sigpending state. This means that signallable freezable kthreads may
continue executing with !freezing() && stuck TIF_SIGPENDING, which can
be troublesome.
This patch removes set_freezable_with_signal() along with
PF_FREEZER_NOSIG and recalc_sigpending*() calls in freezer. User
tasks get TIF_SIGPENDING, kernel tasks get woken up and the spurious
sigpending is dealt with in the usual signal delivery path.
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Diffstat (limited to 'kernel/kthread.c')
-rw-r--r-- | kernel/kthread.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/kernel/kthread.c b/kernel/kthread.c index 1c36deaae2f1..3d3de633702e 100644 --- a/kernel/kthread.c +++ b/kernel/kthread.c @@ -282,7 +282,7 @@ int kthreadd(void *unused) set_cpus_allowed_ptr(tsk, cpu_all_mask); set_mems_allowed(node_states[N_HIGH_MEMORY]); - current->flags |= PF_NOFREEZE | PF_FREEZER_NOSIG; + current->flags |= PF_NOFREEZE; for (;;) { set_current_state(TASK_INTERRUPTIBLE); |