mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: matthltc@us.ibm.com
Cc: Linux-Kernel <linux-kernel@vger.kernel.org>,
	Linux Containers <containers@lists.linux-foundation.org>,
	Cedric Le Goater <clg@fr.ibm.com>,
	linux-pm@lists.linux-foundation.org
Subject: Re: [RFC PATCH 3/4] Container Freezer: Implement freezer cgroup subsystem
Date: Fri, 11 Apr 2008 13:49:47 +0200	[thread overview]
Message-ID: <20080411114947.GD1740@elf.ucw.cz> (raw)
In-Reply-To: <20080403210317.160210906@us.ibm.com>

Hi!

> This patch implements a new freezer subsystem for Paul Menage's 
> control groups framework. It provides a way to stop and resume 
> execution of all tasks in a cgroup by writing in the cgroup 
> filesystem.
> 
> This is the basic mechanism which should do the right thing for 
> user space tasks in a simple scenario. This will require more work 
> to get the freezing right (cf. try_to_freeze_tasks()) for ptraced
> tasks.

> --- /dev/null
> +++ linux-2.6.25-rc8-mm1/include/linux/cgroup_freezer.h
> @@ -0,0 +1,57 @@
> +#ifndef _LINUX_CGROUP_FREEZER_H
> +#define _LINUX_CGROUP_FREEZER_H
> +/*
> + * cgroup_freezer.h -  control group freezer subsystem interface
> + *
> + * Copyright IBM Corp. 2007
> + *
> + * Author : Cedric Le Goater <clg@fr.ibm.com>
> + */

If you have copyright, add GPL.

> --- /dev/null
> +++ linux-2.6.25-rc8-mm1/kernel/cgroup_freezer.c
> @@ -0,0 +1,280 @@
> +/*
> + * cgroup_freezer.c -  control group freezer subsystem
> + *
> + * Copyright IBM Corp. 2007
> + *
> + * Author : Cedric Le Goater <clg@fr.ibm.com>
> + */

Same here.

>+static struct cgroup_subsys_state *freezer_create(
>+       struct cgroup_subsys *ss, struct cgroup *cgroup)
>+{

Function headers are somehow non-traditional.

+       struct freezer *freezer;
+
+       if (!capable(CAP_SYS_ADMIN))
+               return ERR_PTR(-EPERM);
+
+       freezer = kzalloc(sizeof(struct freezer), GFP_KERNEL);
+       if (!freezer)
+               return ERR_PTR(-ENOMEM);
+
+       spin_lock_init(&freezer->lock);
+       freezer->state = STATE_RUNNING;
+       return  &freezer->css;
+}

One space too many after "return" :-).

Hmm, returning pointer inside struct freezer is rather ugly, right?
Could you just pass struct freezer around?
								Pavel

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

  reply	other threads:[~2008-04-11 11:49 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-03 21:03 [RFC PATCH 0/4] Container Freezer: Reuse Suspend Freezer matthltc
2008-04-03 21:03 ` [RFC PATCH 1/4] Container Freezer: Add TIF_FREEZE flag to all architectures matthltc
2008-04-11 11:49   ` Pavel Machek
2008-04-03 21:03 ` [RFC PATCH 2/4] Container Freezer: Make refrigerator always available matthltc
2008-04-03 21:03 ` [RFC PATCH 3/4] Container Freezer: Implement freezer cgroup subsystem matthltc
2008-04-11 11:49   ` Pavel Machek [this message]
2008-04-03 21:03 ` [RFC PATCH 4/4] Container Freezer: Skip frozen cgroups during power management resume matthltc
2008-04-03 23:49 ` [Devel] [RFC PATCH 0/4] Container Freezer: Reuse Suspend Freezer Paul Menage
2008-04-04  3:03   ` Matt Helsley
2008-04-04 15:56     ` Oren Laadan
2008-04-04 22:27       ` Matt Helsley
2008-04-05  0:30         ` Oren Laadan
2008-04-05  0:54           ` Matt Helsley
2008-04-04 14:11   ` Serge E. Hallyn
2008-04-11 11:49 ` Pavel Machek

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=20080411114947.GD1740@elf.ucw.cz \
    --to=pavel@ucw.cz \
    --cc=clg@fr.ibm.com \
    --cc=containers@lists.linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=matthltc@us.ibm.com \
    /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

Powered by JetHome