aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2011-11-23 12:28:17 -0500
committerTejun Heo <tj@kernel.org>2011-11-23 12:28:17 -0500
commit34b087e48367c252e343c2f8de65676a78af1e4a (patch)
treefbe94bad0a3073c6f4231752fba99c6bc8702277 /include
parentadfa543e7314b36ac55a40019977de6e47946dd7 (diff)
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 'include')
-rw-r--r--include/linux/freezer.h20
-rw-r--r--include/linux/sched.h1
2 files changed, 1 insertions, 20 deletions
diff --git a/include/linux/freezer.h b/include/linux/freezer.h
index a28842e588f4..a33550fc05c5 100644
--- a/include/linux/freezer.h
+++ b/include/linux/freezer.h
@@ -49,7 +49,7 @@ static inline bool try_to_freeze(void)
49} 49}
50 50
51extern bool freeze_task(struct task_struct *p); 51extern bool freeze_task(struct task_struct *p);
52extern bool __set_freezable(bool with_signal); 52extern bool set_freezable(void);
53 53
54#ifdef CONFIG_CGROUP_FREEZER 54#ifdef CONFIG_CGROUP_FREEZER
55extern bool cgroup_freezing(struct task_struct *task); 55extern bool cgroup_freezing(struct task_struct *task);
@@ -105,23 +105,6 @@ static inline int freezer_should_skip(struct task_struct *p)
105} 105}
106 106
107/* 107/*
108 * Tell the freezer that the current task should be frozen by it
109 */
110static inline bool set_freezable(void)
111{
112 return __set_freezable(false);
113}
114
115/*
116 * Tell the freezer that the current task should be frozen by it and that it
117 * should send a fake signal to the task to freeze it.
118 */
119static inline bool set_freezable_with_signal(void)
120{
121 return __set_freezable(true);
122}
123
124/*
125 * Freezer-friendly wrappers around wait_event_interruptible(), 108 * Freezer-friendly wrappers around wait_event_interruptible(),
126 * wait_event_killable() and wait_event_interruptible_timeout(), originally 109 * wait_event_killable() and wait_event_interruptible_timeout(), originally
127 * defined in <linux/wait.h> 110 * defined in <linux/wait.h>
@@ -176,7 +159,6 @@ static inline void freezer_do_not_count(void) {}
176static inline void freezer_count(void) {} 159static inline void freezer_count(void) {}
177static inline int freezer_should_skip(struct task_struct *p) { return 0; } 160static inline int freezer_should_skip(struct task_struct *p) { return 0; }
178static inline void set_freezable(void) {} 161static inline void set_freezable(void) {}
179static inline void set_freezable_with_signal(void) {}
180 162
181#define wait_event_freezable(wq, condition) \ 163#define wait_event_freezable(wq, condition) \
182 wait_event_interruptible(wq, condition) 164 wait_event_interruptible(wq, condition)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index d12bd03b688f..2f90470ad843 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1788,7 +1788,6 @@ extern void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t *
1788#define PF_MEMPOLICY 0x10000000 /* Non-default NUMA mempolicy */ 1788#define PF_MEMPOLICY 0x10000000 /* Non-default NUMA mempolicy */
1789#define PF_MUTEX_TESTER 0x20000000 /* Thread belongs to the rt mutex tester */ 1789#define PF_MUTEX_TESTER 0x20000000 /* Thread belongs to the rt mutex tester */
1790#define PF_FREEZER_SKIP 0x40000000 /* Freezer should not count it as freezable */ 1790#define PF_FREEZER_SKIP 0x40000000 /* Freezer should not count it as freezable */
1791#define PF_FREEZER_NOSIG 0x80000000 /* Freezer won't send signals to it */
1792 1791
1793/* 1792/*
1794 * Only the _current_ task can read/write to tsk->flags, but other 1793 * Only the _current_ task can read/write to tsk->flags, but other