From: Tejun Heo <htejun-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Michal Hocko <mhocko-AlSwsSmVLrQ@public.gmane.org>
Cc: Li Zefan <lizf-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org,
Tomasz Buchert <tomasz.buchert-MZpvjPyXg2s@public.gmane.org>,
Paul Menage <paul-inf54ven1CmVyaH7bEyXVA@public.gmane.org>,
Andrew Morton
<akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
Subject: Re: [PATCH] cgroup_freezer: fix freezing groups with stopped tasks
Date: Tue, 22 Nov 2011 07:39:48 -0800 [thread overview]
Message-ID: <20111122153948.GE322@google.com> (raw)
In-Reply-To: <20111122090522.GA26768-VqjxzfR4DlwKmadIfiO5sKVXKuFTiq87@public.gmane.org>
Hello, Michal.
On Tue, Nov 22, 2011 at 10:05:22AM +0100, Michal Hocko wrote:
> I am not sure which BUG_ON you have in mind.
> update_if_frozen:
> BUG_ON(nfrozen != ntotal);
Heh, try to put a kthread into the cgroup and freeze it. :)
> From aba1042a96b6e79e0b14e3c397389389c9e2f522 Mon Sep 17 00:00:00 2001
> From: Michal Hocko <mhocko-AlSwsSmVLrQ@public.gmane.org>
> Date: Wed, 16 Nov 2011 22:38:42 +0100
> Subject: [PATCH] cgroup_freezer: fix freezing groups with stopped tasks
>
> 2d3cbf8b (cgroup_freezer: update_freezer_state() does incorrect state
> transitions) removed is_task_frozen_enough and replaced it with a simple
> frozen call. This, however, breaks freezing for a group with stopped tasks
> because those cannot be frozen and so the group remains in CGROUP_FREEZING
> state (update_if_frozen doesn't count stopped tasks) and never reaches
> CGROUP_FROZEN.
>
> Let's add is_task_frozen_enough back and use it at the original locations
> (update_if_frozen and try_to_freeze_cgroup). Semantically we consider
> stopped tasks as frozen enough so we should consider both cases when
> testing frozen tasks.
>
> Testcase:
> mkdir /dev/freezer
> mount -t cgroup -o freezer none /dev/freezer
> mkdir /dev/freezer/foo
> sleep 1h &
> pid=$!
> kill -STOP $pid
> echo $pid > /dev/freezer/foo/tasks
> echo FROZEN > /dev/freezer/foo/freezer.state
> while true
> do
> cat /dev/freezer/foo/freezer.state
> [ "`cat /dev/freezer/foo/freezer.state`" = "FROZEN" ] && break
> sleep 1
> done
> echo OK
>
> Signed-off-by: Michal Hocko <mhocko-AlSwsSmVLrQ@public.gmane.org>
> Cc: Tomasz Buchert <tomasz.buchert-MZpvjPyXg2s@public.gmane.org>
> Cc: Paul Menage <paul-inf54ven1CmVyaH7bEyXVA@public.gmane.org>
> Cc: Li Zefan <lizf-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
> Cc: Andrew Morton <akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org>
> Cc: Tejun Heo <htejun-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Applying to cgroup/for-3.2-fixes.
Thank you.
--
tejun
--
To unsubscribe from this list: send the line "unsubscribe cgroups" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2011-11-22 15:39 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-16 21:50 [PATCH] cgroup_freezer: fix freezing groups with stopped tasks Michal Hocko
[not found] ` <1321480234-29241-1-git-send-email-mhocko-AlSwsSmVLrQ@public.gmane.org>
2011-11-17 10:14 ` Tomasz Buchert
[not found] ` <4EC4DE9D.3040703-MZpvjPyXg2s@public.gmane.org>
2011-11-17 16:13 ` Michal Hocko
[not found] ` <20111117161318.GA1233-VqjxzfR4DlwKmadIfiO5sKVXKuFTiq87@public.gmane.org>
2011-11-17 17:03 ` Tomasz Buchert
2011-11-21 13:40 ` Michal Hocko
2011-11-21 23:07 ` Tejun Heo
[not found] ` <20111121230709.GR25776-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2011-11-22 2:20 ` Li Zefan
[not found] ` <4ECB06D2.6060106-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org>
2011-11-22 2:21 ` Tejun Heo
[not found] ` <20111122022118.GT25776-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2011-11-22 9:05 ` Michal Hocko
[not found] ` <20111122090522.GA26768-VqjxzfR4DlwKmadIfiO5sKVXKuFTiq87@public.gmane.org>
2011-11-22 15:39 ` Tejun Heo [this message]
[not found] ` <20111122153948.GE322-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2011-11-22 15:48 ` Tejun Heo
[not found] ` <20111122154748.GF322-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2011-11-23 2:00 ` Li Zefan
2011-11-24 10:04 ` Michal Hocko
[not found] ` <20111124100454.GE26036-VqjxzfR4DlwKmadIfiO5sKVXKuFTiq87@public.gmane.org>
2011-11-24 20:00 ` Tejun Heo
[not found] ` <20111124200009.GB6735-hpIqsD4AKlfQT0dZR+AlfA@public.gmane.org>
2011-11-24 21:52 ` Michal Hocko
2011-11-22 15:56 ` Michal Hocko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20111122153948.GE322@google.com \
--to=htejun-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=akpm-de/tnXTf+JLsfHDXvbKv3WD2FQJk+8+b@public.gmane.org \
--cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=lizf-BthXqXjhjHXQFUHtdCDX3A@public.gmane.org \
--cc=mhocko-AlSwsSmVLrQ@public.gmane.org \
--cc=paul-inf54ven1CmVyaH7bEyXVA@public.gmane.org \
--cc=tomasz.buchert-MZpvjPyXg2s@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).