From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tejun Heo Subject: Re: [PATCH 6/9] cgroup_freezer: make freezer->state mask of flags Date: Thu, 8 Nov 2012 06:39:52 -0800 Message-ID: <20121108143952.GD12973@htj.dyndns.org> References: <1351931915-1701-1-git-send-email-tj@kernel.org> <1351931915-1701-7-git-send-email-tj@kernel.org> <20121108103928.GD31821@dhcp22.suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <20121108103928.GD31821-2MMpYkNvuYDjFM9bn6wA6Q@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: containers-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Michal Hocko Cc: linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, fweisbec-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org, containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, rjw-KKrjLPT3xs0@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-pm@vger.kernel.org Hello, Michal. On Thu, Nov 08, 2012 at 11:39:28AM +0100, Michal Hocko wrote: > On Sat 03-11-12 01:38:32, Tejun Heo wrote: > > freezer->state was an enum value - one of THAWED, FREEZING and FROZEN. > > As the scheduled full hierarchy support requires more than one > > freezing condition, switch it to mask of flags. If FREEZING is not > > set, it's thawed. FREEZING is set if freezing or frozen. If frozen, > > both FREEZING and FROZEN are set. Now that tasks can be attached to > > an already frozen cgroup, this also makes freezing condition checks > > more natural. > > > > This patch doesn't introduce any behavior change. > > > > Signed-off-by: Tejun Heo > > I think it would be nicer to use freezer_state_flags enum rather than > unsigned int for the state. I would even expect gcc to complain about > that but it looks like -fstrict-enums is c++ specific (so long enum > safety). But if you use it as flag bits, the resulting value no longer is inside the defined enum values. Isn't that weird? Thanks. -- tejun