diff options
author | Tejun Heo <tj@kernel.org> | 2011-11-21 15:32:26 -0500 |
---|---|---|
committer | Tejun Heo <tj@kernel.org> | 2011-11-21 15:32:26 -0500 |
commit | 839e3407d90a810318d17c17ceb3d5928a910704 (patch) | |
tree | 9b75e8f69cadba5d33537698931cf637a22d423b | |
parent | 37ad8aca94a1da2112a7c56151390914e80d1113 (diff) |
freezer: remove unused @sig_only from freeze_task()
After "freezer: make freezing() test freeze conditions in effect
instead of TIF_FREEZE", freezing() returns authoritative answer on
whether the current task should freeze or not and freeze_task()
doesn't need or use @sig_only. Remove it.
While at it, rewrite function comment for freeze_task() and rename
@sig_only to @user_only in try_to_freeze_tasks().
This patch doesn't cause any functional change.
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Oleg Nesterov <oleg@redhat.com>
-rw-r--r-- | include/linux/freezer.h | 2 | ||||
-rw-r--r-- | kernel/cgroup_freezer.c | 4 | ||||
-rw-r--r-- | kernel/freezer.c | 21 | ||||
-rw-r--r-- | kernel/power/process.c | 8 |
4 files changed, 16 insertions, 19 deletions
diff --git a/include/linux/freezer.h b/include/linux/freezer.h index a0f1b3a3604f..a28842e588f4 100644 --- a/include/linux/freezer.h +++ b/include/linux/freezer.h | |||
@@ -48,7 +48,7 @@ static inline bool try_to_freeze(void) | |||
48 | return __refrigerator(false); | 48 | return __refrigerator(false); |
49 | } | 49 | } |
50 | 50 | ||
51 | extern bool freeze_task(struct task_struct *p, bool sig_only); | 51 | extern bool freeze_task(struct task_struct *p); |
52 | extern bool __set_freezable(bool with_signal); | 52 | extern bool __set_freezable(bool with_signal); |
53 | 53 | ||
54 | #ifdef CONFIG_CGROUP_FREEZER | 54 | #ifdef CONFIG_CGROUP_FREEZER |
diff --git a/kernel/cgroup_freezer.c b/kernel/cgroup_freezer.c index 2327ad11725f..e411a60cc2c8 100644 --- a/kernel/cgroup_freezer.c +++ b/kernel/cgroup_freezer.c | |||
@@ -206,7 +206,7 @@ static void freezer_fork(struct cgroup_subsys *ss, struct task_struct *task) | |||
206 | 206 | ||
207 | /* Locking avoids race with FREEZING -> THAWED transitions. */ | 207 | /* Locking avoids race with FREEZING -> THAWED transitions. */ |
208 | if (freezer->state == CGROUP_FREEZING) | 208 | if (freezer->state == CGROUP_FREEZING) |
209 | freeze_task(task, true); | 209 | freeze_task(task); |
210 | spin_unlock_irq(&freezer->lock); | 210 | spin_unlock_irq(&freezer->lock); |
211 | } | 211 | } |
212 | 212 | ||
@@ -274,7 +274,7 @@ static int try_to_freeze_cgroup(struct cgroup *cgroup, struct freezer *freezer) | |||
274 | 274 | ||
275 | cgroup_iter_start(cgroup, &it); | 275 | cgroup_iter_start(cgroup, &it); |
276 | while ((task = cgroup_iter_next(cgroup, &it))) { | 276 | while ((task = cgroup_iter_next(cgroup, &it))) { |
277 | if (!freeze_task(task, true)) | 277 | if (!freeze_task(task)) |
278 | continue; | 278 | continue; |
279 | if (frozen(task)) | 279 | if (frozen(task)) |
280 | continue; | 280 | continue; |
diff --git a/kernel/freezer.c b/kernel/freezer.c index 389549f0a94e..2589a61de44c 100644 --- a/kernel/freezer.c +++ b/kernel/freezer.c | |||
@@ -100,20 +100,17 @@ static void fake_signal_wake_up(struct task_struct *p) | |||
100 | } | 100 | } |
101 | 101 | ||
102 | /** | 102 | /** |
103 | * freeze_task - send a freeze request to given task | 103 | * freeze_task - send a freeze request to given task |
104 | * @p: task to send the request to | 104 | * @p: task to send the request to |
105 | * @sig_only: if set, the request will only be sent if the task has the | ||
106 | * PF_FREEZER_NOSIG flag unset | ||
107 | * Return value: 'false', if @sig_only is set and the task has | ||
108 | * PF_FREEZER_NOSIG set or the task is frozen, 'true', otherwise | ||
109 | * | 105 | * |
110 | * The freeze request is sent by setting the tasks's TIF_FREEZE flag and | 106 | * If @p is freezing, the freeze request is sent by setting %TIF_FREEZE |
111 | * either sending a fake signal to it or waking it up, depending on whether | 107 | * flag and either sending a fake signal to it or waking it up, depending |
112 | * or not it has PF_FREEZER_NOSIG set. If @sig_only is set and the task | 108 | * on whether it has %PF_FREEZER_NOSIG set. |
113 | * has PF_FREEZER_NOSIG set (ie. it is a typical kernel thread), its | 109 | * |
114 | * TIF_FREEZE flag will not be set. | 110 | * RETURNS: |
111 | * %false, if @p is not freezing or already frozen; %true, otherwise | ||
115 | */ | 112 | */ |
116 | bool freeze_task(struct task_struct *p, bool sig_only) | 113 | bool freeze_task(struct task_struct *p) |
117 | { | 114 | { |
118 | unsigned long flags; | 115 | unsigned long flags; |
119 | 116 | ||
diff --git a/kernel/power/process.c b/kernel/power/process.c index 0beb51e1dec9..77274c9ba2f1 100644 --- a/kernel/power/process.c +++ b/kernel/power/process.c | |||
@@ -22,7 +22,7 @@ | |||
22 | */ | 22 | */ |
23 | #define TIMEOUT (20 * HZ) | 23 | #define TIMEOUT (20 * HZ) |
24 | 24 | ||
25 | static int try_to_freeze_tasks(bool sig_only) | 25 | static int try_to_freeze_tasks(bool user_only) |
26 | { | 26 | { |
27 | struct task_struct *g, *p; | 27 | struct task_struct *g, *p; |
28 | unsigned long end_time; | 28 | unsigned long end_time; |
@@ -37,14 +37,14 @@ static int try_to_freeze_tasks(bool sig_only) | |||
37 | 37 | ||
38 | end_time = jiffies + TIMEOUT; | 38 | end_time = jiffies + TIMEOUT; |
39 | 39 | ||
40 | if (!sig_only) | 40 | if (!user_only) |
41 | freeze_workqueues_begin(); | 41 | freeze_workqueues_begin(); |
42 | 42 | ||
43 | while (true) { | 43 | while (true) { |
44 | todo = 0; | 44 | todo = 0; |
45 | read_lock(&tasklist_lock); | 45 | read_lock(&tasklist_lock); |
46 | do_each_thread(g, p) { | 46 | do_each_thread(g, p) { |
47 | if (p == current || !freeze_task(p, sig_only)) | 47 | if (p == current || !freeze_task(p)) |
48 | continue; | 48 | continue; |
49 | 49 | ||
50 | /* | 50 | /* |
@@ -65,7 +65,7 @@ static int try_to_freeze_tasks(bool sig_only) | |||
65 | } while_each_thread(g, p); | 65 | } while_each_thread(g, p); |
66 | read_unlock(&tasklist_lock); | 66 | read_unlock(&tasklist_lock); |
67 | 67 | ||
68 | if (!sig_only) { | 68 | if (!user_only) { |
69 | wq_busy = freeze_workqueues_busy(); | 69 | wq_busy = freeze_workqueues_busy(); |
70 | todo += wq_busy; | 70 | todo += wq_busy; |
71 | } | 71 | } |