* [PATCH] Remove update_freezer_state()
@ 2011-01-27 13:14 Matt Helsley
[not found] ` <bcd897d608bc2de8867fb3a031e5affc352fb559.1296134057.git.matthltc-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 2+ messages in thread
From: Matt Helsley @ 2011-01-27 13:14 UTC (permalink / raw)
To: Oren Laadan; +Cc: Linux Containers
update_freezer_state() was renamed to update_if_frozen(). Use the
newly name of the function and remove the old copy.
Signed-off-by: Matt Helsley <matthltc-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
---
kernel/cgroup_freezer.c | 33 +--------------------------------
1 files changed, 1 insertions(+), 32 deletions(-)
diff --git a/kernel/cgroup_freezer.c b/kernel/cgroup_freezer.c
index 507cb43..2691bd8 100644
--- a/kernel/cgroup_freezer.c
+++ b/kernel/cgroup_freezer.c
@@ -72,37 +72,6 @@ static bool is_task_frozen_enough(struct task_struct *task)
}
/*
- * caller must hold freezer->lock
- */
-static void update_freezer_state(struct cgroup *cgroup,
- struct freezer *freezer)
-{
- struct cgroup_iter it;
- struct task_struct *task;
- unsigned int nfrozen = 0, ntotal = 0;
-
- cgroup_iter_start(cgroup, &it);
- while ((task = cgroup_iter_next(cgroup, &it))) {
- ntotal++;
- if (is_task_frozen_enough(task))
- nfrozen++;
- }
-
- /*
- * Transition to FROZEN when no new tasks can be added ensures
- * that we never exist in the FROZEN state while there are unfrozen
- * tasks.
- */
- if (nfrozen == ntotal)
- freezer->state = CGROUP_FROZEN;
- else if (nfrozen > 0)
- freezer->state = CGROUP_FREEZING;
- else
- freezer->state = CGROUP_THAWED;
- cgroup_iter_end(cgroup, &it);
-}
-
-/*
* cgroups_write_string() limits the size of freezer state strings to
* CGROUP_LOCAL_BUFFER_SIZE
*/
@@ -485,7 +454,7 @@ static int freezer_checkpointing(struct task_struct *task,
/* May be in middle of a lazy FREEZING -> FROZEN transition */
if (cgroup_lock_live_group(css->cgroup)) {
spin_lock_irq(&freezer->lock);
- update_freezer_state(css->cgroup, freezer);
+ update_if_frozen(css->cgroup, freezer);
spin_unlock_irq(&freezer->lock);
cgroup_unlock();
}
--
1.6.3.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] Remove update_freezer_state()
[not found] ` <bcd897d608bc2de8867fb3a031e5affc352fb559.1296134057.git.matthltc-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
@ 2011-03-26 2:10 ` Oren Laadan
0 siblings, 0 replies; 2+ messages in thread
From: Oren Laadan @ 2011-03-26 2:10 UTC (permalink / raw)
To: Matt Helsley; +Cc: Linux Containers
Pulled for v23-rc2.
Oren.
On 01/27/2011 08:14 AM, Matt Helsley wrote:
> update_freezer_state() was renamed to update_if_frozen(). Use the
> newly name of the function and remove the old copy.
>
> Signed-off-by: Matt Helsley <matthltc-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
> ---
> kernel/cgroup_freezer.c | 33 +--------------------------------
> 1 files changed, 1 insertions(+), 32 deletions(-)
>
> diff --git a/kernel/cgroup_freezer.c b/kernel/cgroup_freezer.c
> index 507cb43..2691bd8 100644
> --- a/kernel/cgroup_freezer.c
> +++ b/kernel/cgroup_freezer.c
> @@ -72,37 +72,6 @@ static bool is_task_frozen_enough(struct task_struct *task)
> }
>
> /*
> - * caller must hold freezer->lock
> - */
> -static void update_freezer_state(struct cgroup *cgroup,
> - struct freezer *freezer)
> -{
> - struct cgroup_iter it;
> - struct task_struct *task;
> - unsigned int nfrozen = 0, ntotal = 0;
> -
> - cgroup_iter_start(cgroup, &it);
> - while ((task = cgroup_iter_next(cgroup, &it))) {
> - ntotal++;
> - if (is_task_frozen_enough(task))
> - nfrozen++;
> - }
> -
> - /*
> - * Transition to FROZEN when no new tasks can be added ensures
> - * that we never exist in the FROZEN state while there are unfrozen
> - * tasks.
> - */
> - if (nfrozen == ntotal)
> - freezer->state = CGROUP_FROZEN;
> - else if (nfrozen > 0)
> - freezer->state = CGROUP_FREEZING;
> - else
> - freezer->state = CGROUP_THAWED;
> - cgroup_iter_end(cgroup, &it);
> -}
> -
> -/*
> * cgroups_write_string() limits the size of freezer state strings to
> * CGROUP_LOCAL_BUFFER_SIZE
> */
> @@ -485,7 +454,7 @@ static int freezer_checkpointing(struct task_struct *task,
> /* May be in middle of a lazy FREEZING -> FROZEN transition */
> if (cgroup_lock_live_group(css->cgroup)) {
> spin_lock_irq(&freezer->lock);
> - update_freezer_state(css->cgroup, freezer);
> + update_if_frozen(css->cgroup, freezer);
> spin_unlock_irq(&freezer->lock);
> cgroup_unlock();
> }
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-03-26 2:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-27 13:14 [PATCH] Remove update_freezer_state() Matt Helsley
[not found] ` <bcd897d608bc2de8867fb3a031e5affc352fb559.1296134057.git.matthltc-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2011-03-26 2:10 ` Oren Laadan
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.