linux-stable/arch/arm
Matt Helsley dc52ddc0e6 container freezer: implement freezer cgroup subsystem
This patch implements a new freezer subsystem in the control groups
framework.  It provides a way to stop and resume execution of all tasks in
a cgroup by writing in the cgroup filesystem.

The freezer subsystem in the container filesystem defines a file named
freezer.state.  Writing "FROZEN" to the state file will freeze all tasks
in the cgroup.  Subsequently writing "RUNNING" will unfreeze the tasks in
the cgroup.  Reading will return the current state.

* Examples of usage :

   # mkdir /containers/freezer
   # mount -t cgroup -ofreezer freezer  /containers
   # mkdir /containers/0
   # echo $some_pid > /containers/0/tasks

to get status of the freezer subsystem :

   # cat /containers/0/freezer.state
   RUNNING

to freeze all tasks in the container :

   # echo FROZEN > /containers/0/freezer.state
   # cat /containers/0/freezer.state
   FREEZING
   # cat /containers/0/freezer.state
   FROZEN

to unfreeze all tasks in the container :

   # echo RUNNING > /containers/0/freezer.state
   # cat /containers/0/freezer.state
   RUNNING

This is the basic mechanism which should do the right thing for user space
task in a simple scenario.

It's important to note that freezing can be incomplete.  In that case we
return EBUSY.  This means that some tasks in the cgroup are busy doing
something that prevents us from completely freezing the cgroup at this
time.  After EBUSY, the cgroup will remain partially frozen -- reflected
by freezer.state reporting "FREEZING" when read.  The state will remain
"FREEZING" until one of these things happens:

	1) Userspace cancels the freezing operation by writing "RUNNING" to
		the freezer.state file
	2) Userspace retries the freezing operation by writing "FROZEN" to
		the freezer.state file (writing "FREEZING" is not legal
		and returns EIO)
	3) The tasks that blocked the cgroup from entering the "FROZEN"
		state disappear from the cgroup's set of tasks.

[akpm@linux-foundation.org: coding-style fixes]
[akpm@linux-foundation.org: export thaw_process]
Signed-off-by: Cedric Le Goater <clg@fr.ibm.com>
Signed-off-by: Matt Helsley <matthltc@us.ibm.com>
Acked-by: Serge E. Hallyn <serue@us.ibm.com>
Tested-by: Matt Helsley <matthltc@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-10-20 08:52:34 -07:00
..
boot [ARM] 5229/3: Replace some ARMv7 opcodes with the instruction name 2008-10-03 11:32:09 +01:00
common Merge branch 'pxa-all' into devel 2008-10-09 21:33:02 +01:00
configs Merge branch 'omap-all' into devel 2008-10-14 22:24:42 +01:00
include/asm [PATCH] remove unused ibcs2/PER_SVR4 in SET_PERSONALITY 2008-10-16 15:40:05 +02:00
kernel Merge branch 's3c-move' into devel 2008-10-14 22:24:51 +01:00
lib Merge branch 'ptebits' into devel 2008-10-09 21:31:56 +01:00
mach-aaec2000 [ARM] Move include/asm-arm/arch-* to arch/arm/*/include/mach 2008-08-07 09:55:48 +01:00
mach-at91 Merge branch 'pxa-all' into devel 2008-10-09 21:33:02 +01:00
mach-clps711x [ARM] Convert asm/io.h to linux/io.h 2008-09-06 12:10:45 +01:00
mach-clps7500 [ARM] mm: enable sparsemem on clps7500 and RiscPC 2008-10-01 17:24:04 +01:00
mach-davinci Merge branch 's3c-move' into devel 2008-10-14 22:24:51 +01:00
mach-ebsa110 [ARM] Convert asm/io.h to linux/io.h 2008-09-06 12:10:45 +01:00
mach-ep93xx Merge branch 'pxa-all' into devel 2008-10-09 21:33:02 +01:00
mach-footbridge Merge branch 'pxa-all' into devel 2008-10-09 21:33:02 +01:00
mach-h720x Merge branch 'pxa-all' into devel 2008-10-09 21:33:02 +01:00
mach-imx Merge branch 'for-rmk' of git://pasiphae.extern.pengutronix.de/git/imx/linux-2.6.git 2008-10-09 21:33:03 +01:00
mach-integrator cpufreq: remove policy->governor setting in drivers initialization 2008-10-15 16:42:47 -07:00
mach-iop13xx Merge branch 'pxa-all' into devel 2008-10-09 21:33:02 +01:00
mach-iop32x [ARM] Convert asm/io.h to linux/io.h 2008-09-06 12:10:45 +01:00
mach-iop33x [ARM] Convert asm/io.h to linux/io.h 2008-09-06 12:10:45 +01:00
mach-ixp4xx [ARM] Convert asm/delay.h to linux/delay.h 2008-09-06 12:11:37 +01:00
mach-ixp23xx Merge branch 'pxa-all' into devel 2008-10-09 21:33:02 +01:00
mach-ixp2000 Merge branch 'pxa-all' into devel 2008-10-09 21:33:02 +01:00
mach-kirkwood Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm 2008-10-11 10:09:45 -07:00
mach-ks8695 Merge branches 'machtypes', 'core', 'ep93xx', 'ks8695', 'netdev' and 'sa1100' into devel 2008-10-09 21:31:54 +01:00
mach-l7200 [ARM] Move include/asm-arm/arch-* to arch/arm/*/include/mach 2008-08-07 09:55:48 +01:00
mach-lh7a40x Merge branch 'pxa-all' into devel 2008-10-09 21:33:02 +01:00
mach-loki Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm 2008-10-11 10:09:45 -07:00
mach-msm [ARM] Convert asm/io.h to linux/io.h 2008-09-06 12:10:45 +01:00
mach-mv78xx0 Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm 2008-10-11 10:09:45 -07:00
mach-mx2 i.MX2: make SoC devices globally available 2008-09-09 10:19:41 +02:00
mach-mx3 Merge branch 'for-rmk' of git://source.mvista.com/git/linux-davinci-2.6.git 2008-10-09 21:33:05 +01:00
mach-netx Merge branch 'pxa-all' into devel 2008-10-09 21:33:02 +01:00
mach-ns9xxx Merge branch 'pxa-all' into devel 2008-10-09 21:33:02 +01:00
mach-omap1 Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm 2008-10-16 11:25:32 -07:00
mach-omap2 Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm 2008-10-16 11:25:32 -07:00
mach-orion5x Merge git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog 2008-10-12 11:51:32 -07:00
mach-pnx4008 [ARM] Convert asm/io.h to linux/io.h 2008-09-06 12:10:45 +01:00
mach-pxa Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm 2008-10-16 11:25:32 -07:00
mach-realview [ARM] Convert asm/io.h to linux/io.h 2008-09-06 12:10:45 +01:00
mach-rpc [ARM] mm: enable sparsemem on clps7500 and RiscPC 2008-10-01 17:24:04 +01:00
mach-s3c2400 [ARM] Convert asm/io.h to linux/io.h 2008-09-06 12:10:45 +01:00
mach-s3c2410 Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm 2008-10-16 11:25:32 -07:00
mach-s3c2412 Merge branch 's3c-move' into devel 2008-10-14 22:24:51 +01:00
mach-s3c2440 Merge branch 's3c-move' into devel 2008-10-14 22:24:51 +01:00
mach-s3c2442 Merge branch 's3c-move' into devel 2008-10-14 22:24:51 +01:00
mach-s3c2443 Merge branch 's3c-move' into devel 2008-10-14 22:24:51 +01:00
mach-sa1100 cpufreq: remove policy->governor setting in drivers initialization 2008-10-15 16:42:47 -07:00
mach-shark [ARM] Convert asm/io.h to linux/io.h 2008-09-06 12:10:45 +01:00
mach-versatile Merge branch 's3c-move' into devel 2008-10-14 22:24:51 +01:00
mm Merge branch 'omap-all' into devel 2008-10-14 22:24:42 +01:00
nwfpe [ARM] Convert asm/uaccess.h to linux/uaccess.h 2008-09-06 11:35:55 +01:00
oprofile [ARM] Convert asm/io.h to linux/io.h 2008-09-06 12:10:45 +01:00
plat-iop [ARM] Convert asm/io.h to linux/io.h 2008-09-06 12:10:45 +01:00
plat-mxc Merge branch 'for-rmk' of git://pasiphae.extern.pengutronix.de/git/imx/linux-2.6.git 2008-10-09 21:33:03 +01:00
plat-omap Merge branch 'fixes' into for-linus 2008-10-15 23:16:07 +01:00
plat-orion [ARM] Move include/asm-arm/plat-orion to arch/arm/plat-orion/include/plat 2008-08-09 13:44:58 +02:00
plat-s3c [ARM] S3C24XX: Additional include moves 2008-10-07 23:09:51 +01:00
plat-s3c24xx Merge branch 's3c-move' into devel 2008-10-14 22:24:51 +01:00
tools [ARM] Update mach-types 2008-09-25 10:12:25 +01:00
vfp [ARM] 5227/1: Add the ENDPROC declarations to the .S files 2008-09-01 12:06:34 +01:00
Kconfig container freezer: implement freezer cgroup subsystem 2008-10-20 08:52:34 -07:00
Kconfig-nommu
Kconfig.debug
Makefile Merge branch 's3c-move' into devel 2008-10-14 22:24:51 +01:00