* [PATCH 0/6] Container Freezer: Reuse Suspend Freezer
@ 2008-08-01 5:06 Matt Helsley
2008-08-01 5:07 ` [PATCH 1/6] Container Freezer: Add TIF_FREEZE flag to all architectures Matt Helsley
` (6 more replies)
0 siblings, 7 replies; 27+ messages in thread
From: Matt Helsley @ 2008-08-01 5:06 UTC (permalink / raw)
To: Andrew Morton
Cc: Rafael J. Wysocki, Paul Menage, Li Zefan, Linux-Kernel,
Linux Containers, linux-pm
This patch series introduces a cgroup subsystem that utilizes the swsusp
freezer to freeze a group of tasks. It's immediately useful for batch job
management scripts. It should also be useful in the future for implementing
container checkpoint/restart.
The freezer subsystem in the container filesystem defines a cgroup file named
freezer.state. Reading freezer.state will return the current state of the
cgroup. Writing "FROZEN" to the state file will freeze all tasks in the
cgroup. Subsequently writing "RUNNING" will unfreeze the tasks in the cgroup.
* 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
Andrew, since I hear Rafael doesn't have time to review these (again) at this
time, please consider these patches for -mm.
Cheers,
-Matt Helsley
Changes since v4:
v5:
Split out write_string as a separate patch for easier merging
with trees lacking certain cgroup patches at the time.
Checked use of task alloc lock for races with swsusp freeze/thaw --
looks safe because there are explicit barriers to handle
freeze/thaw races for individual tasks, we explicitly
handle partial group freezing, and partial group thawing
should be resolved without changing swsusp's loop.
Updated the patches to Linus' git tree as of approximately
7/31/2008.
Added Pavel and Serge's Acked-by lines to Acked patches
v4 (Almost all of these changes are confined to patch 3):
Reworked the series to use task_lock() instead of RCU.
Reworked the series to use write_string() and read_seq_string()
cgroup methods.
Fixed the race Paul Menage identified.
Fixed up check_if_frozen() to do more than just test the FROZEN
flag. In some cases tasks could be stopped (T) and marked
FREEZING. When that happens we can safely assume that it
will be frozen immediately upon waking up in the kernel.
Waiting for it to get marked with PF_FROZEN in order to
transition to the FROZEN state would block unnecessarily.
Removed freezer_ prefix from static functions in cgroup_freezer.c.
Simplified STATE_ switch.
Updated the locking comments.
v3:
Ported to 2.6.26-rc5-mm2 with Rafael's freezer patches
Tested on 24 combinations of 3 architectures (x86, x86_64, ppc64)
with 8 different kernel configs varying power management
and cgroup config variables. Each patch builds and boots
in these 24 combinations.
Passes functional testing.
v2 (roughly patches 3 and 5):
Moved the "kill" file into a separate cgroup subsystem (signal) and
it's own patch.
Changed the name of the file from freezer.freeze to freezer.state.
Switched from taking 1 and 0 as input to the strings "FROZEN" and
"RUNNING", respectively. This helps keep the interface
human-usable if/when we need to more states.
Checked that stopped or interrupted is "frozen enough"
Since try_to_freeze() is called upon wakeup of these tasks
this should be fine. This idea comes from recent changes to
the freezer.
Checked that if (task == current) whilst freezing cgroup we're ok
Fixed bug where -EBUSY would always be returned when freezing
Added code to handle userspace retries for any remaining -EBUSY
--
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH 1/6] Container Freezer: Add TIF_FREEZE flag to all architectures
2008-08-01 5:06 [PATCH 0/6] Container Freezer: Reuse Suspend Freezer Matt Helsley
@ 2008-08-01 5:07 ` Matt Helsley
2008-08-01 10:32 ` Nigel Cunningham
2008-08-01 5:07 ` [PATCH 2/6] Container Freezer: Make refrigerator always available Matt Helsley
` (5 subsequent siblings)
6 siblings, 1 reply; 27+ messages in thread
From: Matt Helsley @ 2008-08-01 5:07 UTC (permalink / raw)
To: Andrew Morton
Cc: Rafael J. Wysocki, Paul Menage, Li Zefan, Linux-Kernel,
Linux Containers, linux-pm, Cedric Le Goater, Pavel Machek,
Serge E. Hallyn
This patch is the first step in making the refrigerator() available
to all architectures, even for those without power management.
The purpose of such a change is to be able to use the refrigerator()
in a new control group subsystem which will implement a control group
freezer.
Signed-off-by: Cedric Le Goater <clg@fr.ibm.com>
Signed-off-by: Matt Helsley <matthltc@us.ibm.com>
Acked-by: Pavel Machek <pavel@suse.cz>
Acked-by: Serge E. Hallyn <serue@us.ibm.com>
Tested-by: Matt Helsley <matthltc@us.ibm.com>
---
arch/parisc/include/asm/thread_info.h | 2 ++
arch/sparc/include/asm/thread_info_32.h | 2 ++
arch/sparc/include/asm/thread_info_64.h | 2 ++
include/asm-alpha/thread_info.h | 2 ++
include/asm-avr32/thread_info.h | 1 +
include/asm-cris/thread_info.h | 2 ++
include/asm-h8300/thread_info.h | 2 ++
include/asm-m68k/thread_info.h | 1 +
include/asm-m68knommu/thread_info.h | 2 ++
include/asm-s390/thread_info.h | 2 ++
include/asm-um/thread_info.h | 2 ++
include/asm-xtensa/thread_info.h | 2 ++
12 files changed, 22 insertions(+)
Index: linux-2.6.27-rc1-mm1/arch/sparc/include/asm/thread_info_32.h
===================================================================
--- linux-2.6.27-rc1-mm1.orig/arch/sparc/include/asm/thread_info_32.h
+++ linux-2.6.27-rc1-mm1/arch/sparc/include/asm/thread_info_32.h
@@ -137,10 +137,11 @@ BTFIXUPDEF_CALL(void, free_thread_info,
#define TIF_USEDFPU 8 /* FPU was used by this task
* this quantum (SMP) */
#define TIF_POLLING_NRFLAG 9 /* true if poll_idle() is polling
* TIF_NEED_RESCHED */
#define TIF_MEMDIE 10
+#define TIF_FREEZE 19 /* is freezing for suspend */
/* as above, but as bit values */
#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
@@ -150,9 +151,10 @@ BTFIXUPDEF_CALL(void, free_thread_info,
#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
#define _TIF_DO_NOTIFY_RESUME_MASK (_TIF_NOTIFY_RESUME | \
_TIF_SIGPENDING | \
_TIF_RESTORE_SIGMASK)
+#define TIF_FREEZE (1<<TIF_FREEZE)
#endif /* __KERNEL__ */
#endif /* _ASM_THREAD_INFO_H */
Index: linux-2.6.27-rc1-mm1/arch/sparc/include/asm/thread_info_64.h
===================================================================
--- linux-2.6.27-rc1-mm1.orig/arch/sparc/include/asm/thread_info_64.h
+++ linux-2.6.27-rc1-mm1/arch/sparc/include/asm/thread_info_64.h
@@ -235,10 +235,11 @@ register struct thread_info *current_thr
* an immediate value in instructions such as andcc.
*/
#define TIF_ABI_PENDING 12
#define TIF_MEMDIE 13
#define TIF_POLLING_NRFLAG 14
+#define TIF_FREEZE 19 /* is freezing for suspend */
#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
@@ -247,10 +248,11 @@ register struct thread_info *current_thr
#define _TIF_32BIT (1<<TIF_32BIT)
#define _TIF_SECCOMP (1<<TIF_SECCOMP)
#define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT)
#define _TIF_ABI_PENDING (1<<TIF_ABI_PENDING)
#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
+#define _TIF_FREEZE (1<<TIF_FREEZE)
#define _TIF_USER_WORK_MASK ((0xff << TI_FLAG_WSAVED_SHIFT) | \
_TIF_DO_NOTIFY_RESUME_MASK | \
_TIF_NEED_RESCHED | _TIF_PERFCTR)
#define _TIF_DO_NOTIFY_RESUME_MASK (_TIF_NOTIFY_RESUME | _TIF_SIGPENDING)
Index: linux-2.6.27-rc1-mm1/include/asm-alpha/thread_info.h
===================================================================
--- linux-2.6.27-rc1-mm1.orig/include/asm-alpha/thread_info.h
+++ linux-2.6.27-rc1-mm1/include/asm-alpha/thread_info.h
@@ -72,16 +72,18 @@ register struct thread_info *__current_t
#define TIF_UAC_NOPRINT 5 /* see sysinfo.h */
#define TIF_UAC_NOFIX 6
#define TIF_UAC_SIGBUS 7
#define TIF_MEMDIE 8
#define TIF_RESTORE_SIGMASK 9 /* restore signal mask in do_signal */
+#define TIF_FREEZE 19 /* is freezing for suspend */
#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
+#define _TIF_FREEZE (1<<TIF_FREEZE)
/* Work to do on interrupt/exception return. */
#define _TIF_WORK_MASK (_TIF_SIGPENDING | _TIF_NEED_RESCHED)
/* Work to do on any return to userspace. */
Index: linux-2.6.27-rc1-mm1/include/asm-avr32/thread_info.h
===================================================================
--- linux-2.6.27-rc1-mm1.orig/include/asm-avr32/thread_info.h
+++ linux-2.6.27-rc1-mm1/include/asm-avr32/thread_info.h
@@ -94,10 +94,11 @@ static inline struct thread_info *curren
#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
#define _TIF_SINGLE_STEP (1 << TIF_SINGLE_STEP)
#define _TIF_MEMDIE (1 << TIF_MEMDIE)
#define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK)
#define _TIF_CPU_GOING_TO_SLEEP (1 << TIF_CPU_GOING_TO_SLEEP)
+#define _TIF_FREEZE (1 << TIF_FREEZE)
/* Note: The masks below must never span more than 16 bits! */
/* work to do on interrupt/exception return */
#define _TIF_WORK_MASK \
Index: linux-2.6.27-rc1-mm1/include/asm-cris/thread_info.h
===================================================================
--- linux-2.6.27-rc1-mm1.orig/include/asm-cris/thread_info.h
+++ linux-2.6.27-rc1-mm1/include/asm-cris/thread_info.h
@@ -86,17 +86,19 @@ struct thread_info {
#define TIF_SIGPENDING 2 /* signal pending */
#define TIF_NEED_RESCHED 3 /* rescheduling necessary */
#define TIF_RESTORE_SIGMASK 9 /* restore signal mask in do_signal() */
#define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */
#define TIF_MEMDIE 17
+#define TIF_FREEZE 19 /* is freezing for suspend */
#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
+#define _TIF_FREEZE (1<<TIF_FREEZE)
#define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */
#define _TIF_ALLWORK_MASK 0x0000FFFF /* work to do on any return to u-space */
#endif /* __KERNEL__ */
Index: linux-2.6.27-rc1-mm1/include/asm-h8300/thread_info.h
===================================================================
--- linux-2.6.27-rc1-mm1.orig/include/asm-h8300/thread_info.h
+++ linux-2.6.27-rc1-mm1/include/asm-h8300/thread_info.h
@@ -87,17 +87,19 @@ static inline struct thread_info *curren
#define TIF_NEED_RESCHED 2 /* rescheduling necessary */
#define TIF_POLLING_NRFLAG 3 /* true if poll_idle() is polling
TIF_NEED_RESCHED */
#define TIF_MEMDIE 4
#define TIF_RESTORE_SIGMASK 5 /* restore signal mask in do_signal() */
+#define TIF_FREEZE 19 /* is freezing for suspend */
/* as above, but as bit values */
#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
+#define _TIF_FREEZE (1<<TIF_FREEZE)
#define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */
#endif /* __KERNEL__ */
Index: linux-2.6.27-rc1-mm1/include/asm-m68k/thread_info.h
===================================================================
--- linux-2.6.27-rc1-mm1.orig/include/asm-m68k/thread_info.h
+++ linux-2.6.27-rc1-mm1/include/asm-m68k/thread_info.h
@@ -50,7 +50,8 @@ struct thread_info {
#define TIF_SIGPENDING 6 /* signal pending */
#define TIF_NEED_RESCHED 7 /* rescheduling necessary */
#define TIF_DELAYED_TRACE 14 /* single step a syscall */
#define TIF_SYSCALL_TRACE 15 /* syscall trace active */
#define TIF_MEMDIE 16
+#define TIF_FREEZE 19 /* thread is freezing for suspend */
#endif /* _ASM_M68K_THREAD_INFO_H */
Index: linux-2.6.27-rc1-mm1/include/asm-m68knommu/thread_info.h
===================================================================
--- linux-2.6.27-rc1-mm1.orig/include/asm-m68knommu/thread_info.h
+++ linux-2.6.27-rc1-mm1/include/asm-m68knommu/thread_info.h
@@ -82,16 +82,18 @@ static inline struct thread_info *curren
#define TIF_SIGPENDING 1 /* signal pending */
#define TIF_NEED_RESCHED 2 /* rescheduling necessary */
#define TIF_POLLING_NRFLAG 3 /* true if poll_idle() is polling
TIF_NEED_RESCHED */
#define TIF_MEMDIE 4
+#define TIF_FREEZE 19 /* is freezing for suspend */
/* as above, but as bit values */
#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
+#define _TIF_FREEZE (1<<TIF_FREEZE)
#define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */
#endif /* __KERNEL__ */
Index: linux-2.6.27-rc1-mm1/include/asm-s390/thread_info.h
===================================================================
--- linux-2.6.27-rc1-mm1.orig/include/asm-s390/thread_info.h
+++ linux-2.6.27-rc1-mm1/include/asm-s390/thread_info.h
@@ -96,10 +96,11 @@ static inline struct thread_info *curren
#define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling
TIF_NEED_RESCHED */
#define TIF_31BIT 18 /* 32bit process */
#define TIF_MEMDIE 19
#define TIF_RESTORE_SIGMASK 20 /* restore signal mask in do_signal() */
+#define TIF_FREEZE 21 /* thread is freezing for suspend */
#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
@@ -108,10 +109,11 @@ static inline struct thread_info *curren
#define _TIF_SINGLE_STEP (1<<TIF_SINGLE_STEP)
#define _TIF_MCCK_PENDING (1<<TIF_MCCK_PENDING)
#define _TIF_USEDFPU (1<<TIF_USEDFPU)
#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
#define _TIF_31BIT (1<<TIF_31BIT)
+#define _TIF_FREEZE (1<<TIF_FREEZE)
#endif /* __KERNEL__ */
#define PREEMPT_ACTIVE 0x4000000
Index: linux-2.6.27-rc1-mm1/include/asm-um/thread_info.h
===================================================================
--- linux-2.6.27-rc1-mm1.orig/include/asm-um/thread_info.h
+++ linux-2.6.27-rc1-mm1/include/asm-um/thread_info.h
@@ -67,15 +67,17 @@ static inline struct thread_info *curren
*/
#define TIF_RESTART_BLOCK 4
#define TIF_MEMDIE 5
#define TIF_SYSCALL_AUDIT 6
#define TIF_RESTORE_SIGMASK 7
+#define TIF_FREEZE 19 /* is freezing for suspend */
#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
#define _TIF_MEMDIE (1 << TIF_MEMDIE)
#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)
#define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK)
+#define _TIF_FREEZE (1 << TIF_FREEZE)
#endif
Index: linux-2.6.27-rc1-mm1/include/asm-xtensa/thread_info.h
===================================================================
--- linux-2.6.27-rc1-mm1.orig/include/asm-xtensa/thread_info.h
+++ linux-2.6.27-rc1-mm1/include/asm-xtensa/thread_info.h
@@ -132,18 +132,20 @@ static inline struct thread_info *curren
#define TIF_SINGLESTEP 3 /* restore singlestep on return to user mode */
#define TIF_IRET 4 /* return with iret */
#define TIF_MEMDIE 5
#define TIF_RESTORE_SIGMASK 6 /* restore signal mask in do_signal() */
#define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */
+#define TIF_FREEZE 19 /* is freezing for suspend */
#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
#define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP)
#define _TIF_IRET (1<<TIF_IRET)
#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
+#define _TIF_FREEZE (1<<TIF_FREEZE)
#define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */
#define _TIF_ALLWORK_MASK 0x0000FFFF /* work to do on any return to u-space */
/*
Index: linux-2.6.27-rc1-mm1/arch/parisc/include/asm/thread_info.h
===================================================================
--- linux-2.6.27-rc1-mm1.orig/arch/parisc/include/asm/thread_info.h
+++ linux-2.6.27-rc1-mm1/arch/parisc/include/asm/thread_info.h
@@ -56,17 +56,19 @@ struct thread_info {
#define TIF_NEED_RESCHED 2 /* rescheduling necessary */
#define TIF_POLLING_NRFLAG 3 /* true if poll_idle() is polling TIF_NEED_RESCHED */
#define TIF_32BIT 4 /* 32 bit binary */
#define TIF_MEMDIE 5
#define TIF_RESTORE_SIGMASK 6 /* restore saved signal mask */
+#define TIF_FREEZE 19 /* is freezing for suspend */
#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
#define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
#define _TIF_32BIT (1 << TIF_32BIT)
#define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK)
+#define _TIF_FREEZE (1 << TIF_FREEZE)
#define _TIF_USER_WORK_MASK (_TIF_SIGPENDING | \
_TIF_NEED_RESCHED | _TIF_RESTORE_SIGMASK)
#endif /* __KERNEL__ */
--
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH 2/6] Container Freezer: Make refrigerator always available
2008-08-01 5:06 [PATCH 0/6] Container Freezer: Reuse Suspend Freezer Matt Helsley
2008-08-01 5:07 ` [PATCH 1/6] Container Freezer: Add TIF_FREEZE flag to all architectures Matt Helsley
@ 2008-08-01 5:07 ` Matt Helsley
2008-08-01 10:33 ` Nigel Cunningham
2008-08-01 14:27 ` Thomas Petazzoni
2008-08-01 5:07 ` [PATCH 3/6] Container Freezer: Implement freezer cgroup subsystem Matt Helsley
` (4 subsequent siblings)
6 siblings, 2 replies; 27+ messages in thread
From: Matt Helsley @ 2008-08-01 5:07 UTC (permalink / raw)
To: Andrew Morton
Cc: Rafael J. Wysocki, Paul Menage, Li Zefan, Linux-Kernel,
Linux Containers, linux-pm, Cedric Le Goater, Serge E. Hallyn
Now that the TIF_FREEZE flag is available in all architectures,
extract the refrigerator() and freeze_task() from kernel/power/process.c
and make it available to all.
The refrigerator() can now be used in a control group subsystem
implementing a control group freezer.
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>
---
include/linux/freezer.h | 24 +++++----
kernel/Makefile | 2 +-
kernel/freezer.c | 122 +++++++++++++++++++++++++++++++++++++++++++++++
kernel/power/process.c | 116 --------------------------------------------
4 files changed, 136 insertions(+), 128 deletions(-)
create mode 100644 kernel/freezer.c
diff --git a/include/linux/freezer.h b/include/linux/freezer.h
index deddeed..4081768 100644
--- a/include/linux/freezer.h
+++ b/include/linux/freezer.h
@@ -6,7 +6,6 @@
#include <linux/sched.h>
#include <linux/wait.h>
-#ifdef CONFIG_PM_SLEEP
/*
* Check if a process has been frozen
*/
@@ -39,6 +38,11 @@ static inline void clear_freeze_flag(struct task_struct *p)
clear_tsk_thread_flag(p, TIF_FREEZE);
}
+static inline bool should_send_signal(struct task_struct *p)
+{
+ return !(p->flags & PF_FREEZER_NOSIG);
+}
+
/*
* Wake up a frozen process
*
@@ -63,8 +67,6 @@ static inline int thaw_process(struct task_struct *p)
}
extern void refrigerator(void);
-extern int freeze_processes(void);
-extern void thaw_processes(void);
static inline int try_to_freeze(void)
{
@@ -75,6 +77,14 @@ static inline int try_to_freeze(void)
return 0;
}
+extern bool freeze_task(struct task_struct *p, bool sig_only);
+extern void cancel_freezing(struct task_struct *p);
+
+#ifdef CONFIG_PM_SLEEP
+
+extern int freeze_processes(void);
+extern void thaw_processes(void);
+
/*
* The PF_FREEZER_SKIP flag should be set by a vfork parent right before it
* calls wait_for_completion(&vfork) and reset right after it returns from this
@@ -167,18 +177,10 @@ static inline void set_freezable_with_signal(void)
__retval; \
})
#else /* !CONFIG_PM_SLEEP */
-static inline int frozen(struct task_struct *p) { return 0; }
-static inline int freezing(struct task_struct *p) { return 0; }
-static inline void set_freeze_flag(struct task_struct *p) {}
-static inline void clear_freeze_flag(struct task_struct *p) {}
-static inline int thaw_process(struct task_struct *p) { return 1; }
-static inline void refrigerator(void) {}
static inline int freeze_processes(void) { BUG(); return 0; }
static inline void thaw_processes(void) {}
-static inline int try_to_freeze(void) { return 0; }
-
static inline void freezer_do_not_count(void) {}
static inline void freezer_count(void) {}
static inline int freezer_should_skip(struct task_struct *p) { return 0; }
diff --git a/kernel/Makefile b/kernel/Makefile
index 4e1d7df..9844f47 100644
--- a/kernel/Makefile
+++ b/kernel/Makefile
@@ -5,7 +5,7 @@
obj-y = sched.o fork.o exec_domain.o panic.o printk.o \
cpu.o exit.o itimer.o time.o softirq.o resource.o \
sysctl.o capability.o ptrace.o timer.o user.o \
- signal.o sys.o kmod.o workqueue.o pid.o \
+ signal.o sys.o kmod.o workqueue.o pid.o freezer.o \
rcupdate.o extable.o params.o posix-timers.o \
kthread.o wait.o kfifo.o sys_ni.o posix-cpu-timers.o mutex.o \
hrtimer.o rwsem.o nsproxy.o srcu.o semaphore.o \
diff --git a/kernel/freezer.c b/kernel/freezer.c
new file mode 100644
index 0000000..cb0931f
--- /dev/null
+++ b/kernel/freezer.c
@@ -0,0 +1,122 @@
+/*
+ * kernel/freezer.c - Function to freeze a process
+ *
+ * Originally from kernel/power/process.c
+ */
+
+#include <linux/interrupt.h>
+#include <linux/suspend.h>
+#include <linux/module.h>
+#include <linux/syscalls.h>
+#include <linux/freezer.h>
+
+/*
+ * freezing is complete, mark current process as frozen
+ */
+static inline void frozen_process(void)
+{
+ if (!unlikely(current->flags & PF_NOFREEZE)) {
+ current->flags |= PF_FROZEN;
+ wmb();
+ }
+ clear_freeze_flag(current);
+}
+
+/* Refrigerator is place where frozen processes are stored :-). */
+void refrigerator(void)
+{
+ /* Hmm, should we be allowed to suspend when there are realtime
+ processes around? */
+ long save;
+
+ task_lock(current);
+ if (freezing(current)) {
+ frozen_process();
+ task_unlock(current);
+ } else {
+ task_unlock(current);
+ return;
+ }
+ save = current->state;
+ pr_debug("%s entered refrigerator\n", current->comm);
+
+ spin_lock_irq(¤t->sighand->siglock);
+ recalc_sigpending(); /* We sent fake signal, clean it up */
+ spin_unlock_irq(¤t->sighand->siglock);
+
+ for (;;) {
+ set_current_state(TASK_UNINTERRUPTIBLE);
+ if (!frozen(current))
+ break;
+ schedule();
+ }
+ pr_debug("%s left refrigerator\n", current->comm);
+ __set_current_state(save);
+}
+EXPORT_SYMBOL(refrigerator);
+
+static void fake_signal_wake_up(struct task_struct *p)
+{
+ unsigned long flags;
+
+ spin_lock_irqsave(&p->sighand->siglock, flags);
+ signal_wake_up(p, 0);
+ spin_unlock_irqrestore(&p->sighand->siglock, flags);
+}
+
+/**
+ * freeze_task - send a freeze request to given task
+ * @p: task to send the request to
+ * @sig_only: if set, the request will only be sent if the task has the
+ * PF_FREEZER_NOSIG flag unset
+ * Return value: 'false', if @sig_only is set and the task has
+ * PF_FREEZER_NOSIG set or the task is frozen, 'true', otherwise
+ *
+ * The freeze request is sent by setting the tasks's TIF_FREEZE flag and
+ * either sending a fake signal to it or waking it up, depending on whether
+ * or not it has PF_FREEZER_NOSIG set. If @sig_only is set and the task
+ * has PF_FREEZER_NOSIG set (ie. it is a typical kernel thread), its
+ * TIF_FREEZE flag will not be set.
+ */
+bool freeze_task(struct task_struct *p, bool sig_only)
+{
+ /*
+ * We first check if the task is freezing and next if it has already
+ * been frozen to avoid the race with frozen_process() which first marks
+ * the task as frozen and next clears its TIF_FREEZE.
+ */
+ if (!freezing(p)) {
+ rmb();
+ if (frozen(p))
+ return false;
+
+ if (!sig_only || should_send_signal(p))
+ set_freeze_flag(p);
+ else
+ return false;
+ }
+
+ if (should_send_signal(p)) {
+ if (!signal_pending(p))
+ fake_signal_wake_up(p);
+ } else if (sig_only) {
+ return false;
+ } else {
+ wake_up_state(p, TASK_INTERRUPTIBLE);
+ }
+
+ return true;
+}
+
+void cancel_freezing(struct task_struct *p)
+{
+ unsigned long flags;
+
+ if (freezing(p)) {
+ pr_debug(" clean up: %s\n", p->comm);
+ clear_freeze_flag(p);
+ spin_lock_irqsave(&p->sighand->siglock, flags);
+ recalc_sigpending_and_wake(p);
+ spin_unlock_irqrestore(&p->sighand->siglock, flags);
+ }
+}
diff --git a/kernel/power/process.c b/kernel/power/process.c
index 278946a..444cea8 100644
--- a/kernel/power/process.c
+++ b/kernel/power/process.c
@@ -28,121 +28,6 @@ static inline int freezeable(struct task_struct * p)
return 1;
}
-/*
- * freezing is complete, mark current process as frozen
- */
-static inline void frozen_process(void)
-{
- if (!unlikely(current->flags & PF_NOFREEZE)) {
- current->flags |= PF_FROZEN;
- wmb();
- }
- clear_freeze_flag(current);
-}
-
-/* Refrigerator is place where frozen processes are stored :-). */
-void refrigerator(void)
-{
- /* Hmm, should we be allowed to suspend when there are realtime
- processes around? */
- long save;
-
- task_lock(current);
- if (freezing(current)) {
- frozen_process();
- task_unlock(current);
- } else {
- task_unlock(current);
- return;
- }
- save = current->state;
- pr_debug("%s entered refrigerator\n", current->comm);
-
- spin_lock_irq(¤t->sighand->siglock);
- recalc_sigpending(); /* We sent fake signal, clean it up */
- spin_unlock_irq(¤t->sighand->siglock);
-
- for (;;) {
- set_current_state(TASK_UNINTERRUPTIBLE);
- if (!frozen(current))
- break;
- schedule();
- }
- pr_debug("%s left refrigerator\n", current->comm);
- __set_current_state(save);
-}
-
-static void fake_signal_wake_up(struct task_struct *p)
-{
- unsigned long flags;
-
- spin_lock_irqsave(&p->sighand->siglock, flags);
- signal_wake_up(p, 0);
- spin_unlock_irqrestore(&p->sighand->siglock, flags);
-}
-
-static inline bool should_send_signal(struct task_struct *p)
-{
- return !(p->flags & PF_FREEZER_NOSIG);
-}
-
-/**
- * freeze_task - send a freeze request to given task
- * @p: task to send the request to
- * @sig_only: if set, the request will only be sent if the task has the
- * PF_FREEZER_NOSIG flag unset
- * Return value: 'false', if @sig_only is set and the task has
- * PF_FREEZER_NOSIG set or the task is frozen, 'true', otherwise
- *
- * The freeze request is sent by setting the tasks's TIF_FREEZE flag and
- * either sending a fake signal to it or waking it up, depending on whether
- * or not it has PF_FREEZER_NOSIG set. If @sig_only is set and the task
- * has PF_FREEZER_NOSIG set (ie. it is a typical kernel thread), its
- * TIF_FREEZE flag will not be set.
- */
-static bool freeze_task(struct task_struct *p, bool sig_only)
-{
- /*
- * We first check if the task is freezing and next if it has already
- * been frozen to avoid the race with frozen_process() which first marks
- * the task as frozen and next clears its TIF_FREEZE.
- */
- if (!freezing(p)) {
- rmb();
- if (frozen(p))
- return false;
-
- if (!sig_only || should_send_signal(p))
- set_freeze_flag(p);
- else
- return false;
- }
-
- if (should_send_signal(p)) {
- if (!signal_pending(p))
- fake_signal_wake_up(p);
- } else if (sig_only) {
- return false;
- } else {
- wake_up_state(p, TASK_INTERRUPTIBLE);
- }
-
- return true;
-}
-
-static void cancel_freezing(struct task_struct *p)
-{
- unsigned long flags;
-
- if (freezing(p)) {
- pr_debug(" clean up: %s\n", p->comm);
- clear_freeze_flag(p);
- spin_lock_irqsave(&p->sighand->siglock, flags);
- recalc_sigpending_and_wake(p);
- spin_unlock_irqrestore(&p->sighand->siglock, flags);
- }
-}
-
static int try_to_freeze_tasks(bool sig_only)
{
struct task_struct *g, *p;
@@ -264,4 +149,3 @@ void thaw_processes(void)
printk("done.\n");
}
-EXPORT_SYMBOL(refrigerator);
--
1.5.3.7
--
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 3/6] Container Freezer: Implement freezer cgroup subsystem
2008-08-01 5:06 [PATCH 0/6] Container Freezer: Reuse Suspend Freezer Matt Helsley
2008-08-01 5:07 ` [PATCH 1/6] Container Freezer: Add TIF_FREEZE flag to all architectures Matt Helsley
2008-08-01 5:07 ` [PATCH 2/6] Container Freezer: Make refrigerator always available Matt Helsley
@ 2008-08-01 5:07 ` Matt Helsley
2008-08-01 22:58 ` Rafael J. Wysocki
2008-08-01 5:07 ` [PATCH 4/6] Container Freezer: Skip frozen cgroups during power management resume Matt Helsley
` (3 subsequent siblings)
6 siblings, 1 reply; 27+ messages in thread
From: Matt Helsley @ 2008-08-01 5:07 UTC (permalink / raw)
To: Andrew Morton
Cc: Rafael J. Wysocki, Paul Menage, Li Zefan, Linux-Kernel,
Linux Containers, linux-pm, Cedric Le Goater, Serge E. Hallyn
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.
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>
---
include/linux/cgroup_freezer.h | 71 ++++++++
include/linux/cgroup_subsys.h | 6
include/linux/freezer.h | 16 +-
init/Kconfig | 7
kernel/Makefile | 1
kernel/cgroup_freezer.c | 328 +++++++++++++++++++++++++++++++++++++++++
6 files changed, 425 insertions(+), 4 deletions(-)
create mode 100644 include/linux/cgroup_freezer.h
create mode 100644 kernel/cgroup_freezer.c
Index: linux-2.6.27-rc1-mm1/include/linux/cgroup_freezer.h
===================================================================
--- /dev/null
+++ linux-2.6.27-rc1-mm1/include/linux/cgroup_freezer.h
@@ -0,0 +1,71 @@
+#ifndef _LINUX_CGROUP_FREEZER_H
+#define _LINUX_CGROUP_FREEZER_H
+/*
+ * cgroup_freezer.h - control group freezer subsystem interface
+ *
+ * Copyright IBM Corporation, 2007
+ *
+ * Author : Cedric Le Goater <clg@fr.ibm.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2.1 of the GNU Lesser General Public License
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+#include <linux/cgroup.h>
+
+#ifdef CONFIG_CGROUP_FREEZER
+
+enum freezer_state {
+ STATE_RUNNING = 0,
+ STATE_FREEZING,
+ STATE_FROZEN,
+};
+
+struct freezer {
+ struct cgroup_subsys_state css;
+ enum freezer_state state;
+ spinlock_t lock; /* protects _writes_ to state */
+};
+
+static inline struct freezer *cgroup_freezer(
+ struct cgroup *cgroup)
+{
+ return container_of(
+ cgroup_subsys_state(cgroup, freezer_subsys_id),
+ struct freezer, css);
+}
+
+static inline struct freezer *task_freezer(struct task_struct *task)
+{
+ return container_of(task_subsys_state(task, freezer_subsys_id),
+ struct freezer, css);
+}
+
+static inline int cgroup_frozen(struct task_struct *task)
+{
+ struct freezer *freezer;
+ enum freezer_state state;
+
+ task_lock(task);
+ freezer = task_freezer(task);
+ state = freezer->state;
+ task_unlock(task);
+
+ return state == STATE_FROZEN;
+}
+
+#else /* !CONFIG_CGROUP_FREEZER */
+
+static inline int cgroup_frozen(struct task_struct *task)
+{
+ return 0;
+}
+
+#endif /* !CONFIG_CGROUP_FREEZER */
+
+#endif /* _LINUX_CGROUP_FREEZER_H */
Index: linux-2.6.27-rc1-mm1/include/linux/cgroup_subsys.h
===================================================================
--- linux-2.6.27-rc1-mm1.orig/include/linux/cgroup_subsys.h
+++ linux-2.6.27-rc1-mm1/include/linux/cgroup_subsys.h
@@ -50,5 +50,11 @@ SUBSYS(devices)
#ifdef CONFIG_CGROUP_MEMRLIMIT_CTLR
SUBSYS(memrlimit_cgroup)
#endif
/* */
+
+#ifdef CONFIG_CGROUP_FREEZER
+SUBSYS(freezer)
+#endif
+
+/* */
Index: linux-2.6.27-rc1-mm1/include/linux/freezer.h
===================================================================
--- linux-2.6.27-rc1-mm1.orig/include/linux/freezer.h
+++ linux-2.6.27-rc1-mm1/include/linux/freezer.h
@@ -44,26 +44,34 @@ static inline bool should_send_signal(st
}
/*
* Wake up a frozen process
*
- * task_lock() is taken to prevent the race with refrigerator() which may
+ * task_lock() is needed to prevent the race with refrigerator() which may
* occur if the freezing of tasks fails. Namely, without the lock, if the
* freezing of tasks failed, thaw_tasks() might have run before a task in
* refrigerator() could call frozen_process(), in which case the task would be
* frozen and no one would thaw it.
*/
-static inline int thaw_process(struct task_struct *p)
+static inline int __thaw_process(struct task_struct *p)
{
- task_lock(p);
if (frozen(p)) {
p->flags &= ~PF_FROZEN;
+ return 1;
+ }
+ clear_freeze_flag(p);
+ return 0;
+}
+
+static inline int thaw_process(struct task_struct *p)
+{
+ task_lock(p);
+ if (__thaw_process(p) == 1) {
task_unlock(p);
wake_up_process(p);
return 1;
}
- clear_freeze_flag(p);
task_unlock(p);
return 0;
}
extern void refrigerator(void);
Index: linux-2.6.27-rc1-mm1/init/Kconfig
===================================================================
--- linux-2.6.27-rc1-mm1.orig/init/Kconfig
+++ linux-2.6.27-rc1-mm1/init/Kconfig
@@ -329,10 +329,17 @@ config GROUP_SCHED
default n
help
This feature lets CPU scheduler recognize task groups and control CPU
bandwidth allocation to such task groups.
+config CGROUP_FREEZER
+ bool "control group freezer subsystem"
+ depends on CGROUPS
+ help
+ Provides a way to freeze and unfreeze all tasks in a
+ cgroup
+
config FAIR_GROUP_SCHED
bool "Group scheduling for SCHED_OTHER"
depends on GROUP_SCHED
default GROUP_SCHED
Index: linux-2.6.27-rc1-mm1/kernel/Makefile
===================================================================
--- linux-2.6.27-rc1-mm1.orig/kernel/Makefile
+++ linux-2.6.27-rc1-mm1/kernel/Makefile
@@ -51,10 +51,11 @@ obj-$(CONFIG_PM) += power/
obj-$(CONFIG_BSD_PROCESS_ACCT) += acct.o
obj-$(CONFIG_KEXEC) += kexec.o
obj-$(CONFIG_COMPAT) += compat.o
obj-$(CONFIG_CGROUPS) += cgroup.o
obj-$(CONFIG_CGROUP_DEBUG) += cgroup_debug.o
+obj-$(CONFIG_CGROUP_FREEZER) += cgroup_freezer.o
obj-$(CONFIG_CPUSETS) += cpuset.o
obj-$(CONFIG_CGROUP_NS) += ns_cgroup.o
obj-$(CONFIG_UTS_NS) += utsname.o
obj-$(CONFIG_USER_NS) += user_namespace.o
obj-$(CONFIG_PID_NS) += pid_namespace.o
Index: linux-2.6.27-rc1-mm1/kernel/cgroup_freezer.c
===================================================================
--- /dev/null
+++ linux-2.6.27-rc1-mm1/kernel/cgroup_freezer.c
@@ -0,0 +1,328 @@
+/*
+ * cgroup_freezer.c - control group freezer subsystem
+ *
+ * Copyright IBM Corporation, 2007
+ *
+ * Author : Cedric Le Goater <clg@fr.ibm.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of version 2.1 of the GNU Lesser General Public License
+ * as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it would be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+#include <linux/module.h>
+#include <linux/cgroup.h>
+#include <linux/fs.h>
+#include <linux/uaccess.h>
+#include <linux/freezer.h>
+#include <linux/cgroup_freezer.h>
+#include <linux/seq_file.h>
+
+/*
+ * Buffer size for freezer state is limited by cgroups write_string()
+ * interface. See cgroups code for the current size.
+ */
+static const char *freezer_state_strs[] = {
+ "RUNNING",
+ "FREEZING",
+ "FROZEN",
+};
+#define STATE_MAX_STRLEN 8
+
+/*
+ * State diagram (transition labels in parenthesis):
+ *
+ * RUNNING -(FROZEN)-> FREEZING -(FROZEN)-> FROZEN
+ * ^ ^ | |
+ * | |____(RUNNING)_____| |
+ * |___________________________(RUNNING)____|
+ */
+
+struct cgroup_subsys freezer_subsys;
+
+/* Locks taken and their ordering:
+ *
+ * freezer_create(), freezer_destroy():
+ * cgroup_lock [ by cgroup core ]
+ *
+ * can_attach():
+ * cgroup_lock
+ *
+ * cgroup_frozen():
+ * task_lock
+ *
+ * freezer_fork():
+ * task_lock
+ * freezer->lock
+ * sighand->siglock
+ *
+ * freezer_read():
+ * cgroup_lock
+ * freezer->lock
+ * read_lock css_set_lock
+ *
+ * freezer_write():
+ * cgroup_lock
+ * freezer->lock
+ * read_lock css_set_lock
+ * [unfreeze: task_lock (reaquire freezer->lock)]
+ * sighand->siglock
+ */
+static struct cgroup_subsys_state *freezer_create(struct cgroup_subsys *ss,
+ struct cgroup *cgroup)
+{
+ struct freezer *freezer;
+
+ 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;
+}
+
+static void freezer_destroy(struct cgroup_subsys *ss,
+ struct cgroup *cgroup)
+{
+ kfree(cgroup_freezer(cgroup));
+}
+
+
+static int freezer_can_attach(struct cgroup_subsys *ss,
+ struct cgroup *new_cgroup,
+ struct task_struct *task)
+{
+ struct freezer *freezer;
+ int retval = 0;
+
+ /*
+ * The call to cgroup_lock() in the freezer.state write method prevents
+ * a write to that file racing against an attach, and hence the
+ * can_attach() result will remain valid until the attach completes.
+ */
+ freezer = cgroup_freezer(new_cgroup);
+ if (freezer->state == STATE_FROZEN)
+ retval = -EBUSY;
+ return retval;
+}
+
+static void freezer_fork(struct cgroup_subsys *ss, struct task_struct *task)
+{
+ struct freezer *freezer;
+
+ task_lock(task);
+ freezer = task_freezer(task);
+
+ BUG_ON(freezer->state == STATE_FROZEN);
+
+ /* Locking avoids race with FREEZING -> RUNNING transitions. */
+ spin_lock_irq(&freezer->lock);
+ if (freezer->state == STATE_FREEZING)
+ freeze_task(task, true);
+ spin_unlock_irq(&freezer->lock);
+
+ task_unlock(task);
+}
+
+/*
+ * caller must hold freezer->lock
+ */
+static void check_if_frozen(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++;
+ /*
+ * Task is frozen or will freeze immediately when next it gets
+ * woken
+ */
+ if (frozen(task) ||
+ (task_is_stopped_or_traced(task) && freezing(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 = STATE_FROZEN;
+ cgroup_iter_end(cgroup, &it);
+}
+
+static ssize_t freezer_read(struct cgroup *cgroup, struct cftype *cft,
+ struct seq_file *m)
+{
+ struct freezer *freezer;
+ enum freezer_state state;
+
+ if (!cgroup_lock_live_group(cgroup))
+ return -ENODEV;
+
+ freezer = cgroup_freezer(cgroup);
+ spin_lock_irq(&freezer->lock);
+ state = freezer->state;
+ if (state == STATE_FREEZING) {
+ /* We change from FREEZING to FROZEN lazily if the cgroup was
+ * only partially frozen when we exitted write. */
+ check_if_frozen(cgroup, freezer);
+ state = freezer->state;
+ }
+ spin_unlock_irq(&freezer->lock);
+ cgroup_unlock();
+
+ seq_puts(m, freezer_state_strs[state]);
+ seq_putc(m, '\n');
+ return 0;
+}
+
+static int try_to_freeze_cgroup(struct cgroup *cgroup, struct freezer *freezer)
+{
+ struct cgroup_iter it;
+ struct task_struct *task;
+ unsigned int num_cant_freeze_now = 0;
+
+ freezer->state = STATE_FREEZING;
+ cgroup_iter_start(cgroup, &it);
+ while ((task = cgroup_iter_next(cgroup, &it))) {
+ if (!freeze_task(task, true))
+ continue;
+ if (task_is_stopped_or_traced(task) && freezing(task))
+ /*
+ * The freeze flag is set so these tasks will
+ * immediately go into the fridge upon waking.
+ */
+ continue;
+ if (!freezing(task) && !freezer_should_skip(task))
+ num_cant_freeze_now++;
+ }
+ cgroup_iter_end(cgroup, &it);
+
+ return num_cant_freeze_now ? -EBUSY : 0;
+}
+
+static int unfreeze_cgroup(struct cgroup *cgroup, struct freezer *freezer)
+{
+ struct cgroup_iter it;
+ struct task_struct *task;
+
+ cgroup_iter_start(cgroup, &it);
+ while ((task = cgroup_iter_next(cgroup, &it))) {
+ int do_wake;
+
+ /* Drop freezer->lock to fix lock ordering (see freezer_fork) */
+ spin_unlock_irq(&freezer->lock);
+ task_lock(task);
+ spin_lock_irq(&freezer->lock);
+ do_wake = __thaw_process(task);
+ task_unlock(task);
+ if (do_wake)
+ wake_up_process(task);
+ }
+ cgroup_iter_end(cgroup, &it);
+ freezer->state = STATE_RUNNING;
+
+ return 0;
+}
+
+static int freezer_change_state(struct cgroup *cgroup,
+ enum freezer_state goal_state)
+{
+ struct freezer *freezer;
+ int retval = 0;
+
+ freezer = cgroup_freezer(cgroup);
+ spin_lock_irq(&freezer->lock);
+ check_if_frozen(cgroup, freezer); /* may update freezer->state */
+ if (goal_state == freezer->state)
+ goto out;
+ switch (freezer->state) {
+ case STATE_RUNNING:
+ retval = try_to_freeze_cgroup(cgroup, freezer);
+ break;
+ case STATE_FREEZING:
+ if (goal_state == STATE_FROZEN) {
+ /* Userspace is retrying after
+ * "/bin/echo FROZEN > freezer.state" returned -EBUSY */
+ retval = try_to_freeze_cgroup(cgroup, freezer);
+ break;
+ }
+ /* state == FREEZING and goal_state == RUNNING, so unfreeze */
+ case STATE_FROZEN:
+ retval = unfreeze_cgroup(cgroup, freezer);
+ break;
+ default:
+ break;
+ }
+out:
+ spin_unlock_irq(&freezer->lock);
+
+ return retval;
+}
+
+static ssize_t freezer_write(struct cgroup *cgroup,
+ struct cftype *cft,
+ struct file *file,
+ const char __user *userbuf,
+ size_t nbytes, loff_t *unused_ppos)
+{
+ char buffer[STATE_MAX_STRLEN + 1];
+ int retval = 0;
+ enum freezer_state goal_state;
+
+ if (nbytes >= PATH_MAX)
+ return -E2BIG;
+ nbytes = min(sizeof(buffer) - 1, nbytes);
+ if (copy_from_user(buffer, userbuf, nbytes))
+ return -EFAULT;
+ buffer[nbytes + 1] = 0; /* nul-terminate */
+ strstrip(buffer); /* remove any trailing whitespace */
+ if (strcmp(buffer, freezer_state_strs[STATE_RUNNING]) == 0)
+ goal_state = STATE_RUNNING;
+ else if (strcmp(buffer, freezer_state_strs[STATE_FROZEN]) == 0)
+ goal_state = STATE_FROZEN;
+ else
+ return -EIO;
+
+ if (!cgroup_lock_live_group(cgroup))
+ return -ENODEV;
+ retval = freezer_change_state(cgroup, goal_state);
+ cgroup_unlock();
+ return retval;
+}
+
+static struct cftype files[] = {
+ {
+ .name = "state",
+ .read_seq_string = freezer_read,
+ .write = freezer_write,
+ },
+};
+
+static int freezer_populate(struct cgroup_subsys *ss, struct cgroup *cgroup)
+{
+ return cgroup_add_files(cgroup, ss, files, ARRAY_SIZE(files));
+}
+
+struct cgroup_subsys freezer_subsys = {
+ .name = "freezer",
+ .create = freezer_create,
+ .destroy = freezer_destroy,
+ .populate = freezer_populate,
+ .subsys_id = freezer_subsys_id,
+ .can_attach = freezer_can_attach,
+ .attach = NULL,
+ .fork = freezer_fork,
+ .exit = NULL,
+};
--
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH 4/6] Container Freezer: Skip frozen cgroups during power management resume
2008-08-01 5:06 [PATCH 0/6] Container Freezer: Reuse Suspend Freezer Matt Helsley
` (2 preceding siblings ...)
2008-08-01 5:07 ` [PATCH 3/6] Container Freezer: Implement freezer cgroup subsystem Matt Helsley
@ 2008-08-01 5:07 ` Matt Helsley
2008-08-01 10:24 ` Nigel Cunningham
2008-08-01 5:07 ` [PATCH 5/6] Container Freezer: Prevent frozen tasks or cgroups from changing Matt Helsley
` (2 subsequent siblings)
6 siblings, 1 reply; 27+ messages in thread
From: Matt Helsley @ 2008-08-01 5:07 UTC (permalink / raw)
To: Andrew Morton
Cc: Rafael J. Wysocki, Paul Menage, Li Zefan, Linux-Kernel,
Linux Containers, linux-pm, Cedric Le Goater, Serge E. Hallyn
When a system is resumed after a suspend, it will also unfreeze
frozen cgroups.
This patchs modifies the resume sequence to skip the tasks which
are part of a frozen control group.
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>
---
kernel/power/process.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/kernel/power/process.c b/kernel/power/process.c
index 444cea8..ce9e280 100644
--- a/kernel/power/process.c
+++ b/kernel/power/process.c
@@ -13,6 +13,7 @@
#include <linux/module.h>
#include <linux/syscalls.h>
#include <linux/freezer.h>
+#include <linux/cgroup_freezer.h>
/*
* Timeout for stopping processes
@@ -135,6 +136,9 @@ static void thaw_tasks(bool nosig_only)
if (nosig_only && should_send_signal(p))
continue;
+ if (cgroup_frozen(p))
+ continue;
+
thaw_process(p);
} while_each_thread(g, p);
read_unlock(&tasklist_lock);
--
1.5.3.7
--
^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH 5/6] Container Freezer: Prevent frozen tasks or cgroups from changing
2008-08-01 5:06 [PATCH 0/6] Container Freezer: Reuse Suspend Freezer Matt Helsley
` (3 preceding siblings ...)
2008-08-01 5:07 ` [PATCH 4/6] Container Freezer: Skip frozen cgroups during power management resume Matt Helsley
@ 2008-08-01 5:07 ` Matt Helsley
2008-08-01 5:07 ` [PATCH 6/6] Container Freezer: Use cgroup write_string method Matt Helsley
2008-08-01 5:16 ` [PATCH 0/6] Container Freezer: Reuse Suspend Freezer Matt Helsley
6 siblings, 0 replies; 27+ messages in thread
From: Matt Helsley @ 2008-08-01 5:07 UTC (permalink / raw)
To: Andrew Morton
Cc: Rafael J. Wysocki, Paul Menage, Li Zefan, Linux-Kernel,
Linux Containers, linux-pm
Don't let frozen tasks or cgroups change. This means frozen tasks can't
leave their current cgroup for another cgroup. It also means that tasks
cannot be added to or removed from a cgroup in the FROZEN state. We
enforce these rules by checking for frozen tasks and cgroups in the
can_attach() function.
Signed-off-by: Matt Helsley <matthltc@us.ibm.com>
---
Changes since v4:
v5:
Checked use of task alloc lock for races with swsusp freeze/thaw --
looks safe because there are explicit barriers to handle
freeze/thaw races for individual tasks, we explicitly
handle partial group freezing, and partial group thawing
should be resolved without changing swsusp's loop. This should
answer Li Zefan's last comment re: races between freeze and
thaw.
kernel/cgroup_freezer.c | 43 ++++++++++++++++++++++++++-----------------
1 file changed, 26 insertions(+), 17 deletions(-)
Index: linux-2.6.27-rc1-mm1/kernel/cgroup_freezer.c
===================================================================
--- linux-2.6.27-rc1-mm1.orig/kernel/cgroup_freezer.c
+++ linux-2.6.27-rc1-mm1/kernel/cgroup_freezer.c
@@ -90,26 +90,44 @@ static void freezer_destroy(struct cgrou
struct cgroup *cgroup)
{
kfree(cgroup_freezer(cgroup));
}
+/* Task is frozen or will freeze immediately when next it gets woken */
+static bool is_task_frozen_enough(struct task_struct *task)
+{
+ return frozen(task) ||
+ (task_is_stopped_or_traced(task) && freezing(task));
+}
+/*
+ * The call to cgroup_lock() in the freezer.state write method prevents
+ * a write to that file racing against an attach, and hence the
+ * can_attach() result will remain valid until the attach completes.
+ */
static int freezer_can_attach(struct cgroup_subsys *ss,
struct cgroup *new_cgroup,
struct task_struct *task)
{
struct freezer *freezer;
- int retval = 0;
+ int retval;
+
+ /* Anything frozen can't move or be moved to/from */
+
+ if (is_task_frozen_enough(task))
+ return -EBUSY;
- /*
- * The call to cgroup_lock() in the freezer.state write method prevents
- * a write to that file racing against an attach, and hence the
- * can_attach() result will remain valid until the attach completes.
- */
freezer = cgroup_freezer(new_cgroup);
if (freezer->state == STATE_FROZEN)
+ return -EBUSY;
+
+ retval = 0;
+ task_lock(task);
+ freezer = task_freezer(task);
+ if (freezer->state == STATE_FROZEN)
retval = -EBUSY;
+ task_unlock(task);
return retval;
}
static void freezer_fork(struct cgroup_subsys *ss, struct task_struct *task)
{
@@ -140,16 +158,11 @@ static void check_if_frozen(struct cgrou
unsigned int nfrozen = 0, ntotal = 0;
cgroup_iter_start(cgroup, &it);
while ((task = cgroup_iter_next(cgroup, &it))) {
ntotal++;
- /*
- * Task is frozen or will freeze immediately when next it gets
- * woken
- */
- if (frozen(task) ||
- (task_is_stopped_or_traced(task) && freezing(task)))
+ if (is_task_frozen_enough(task))
nfrozen++;
}
/*
* Transition to FROZEN when no new tasks can be added ensures
@@ -196,15 +209,11 @@ static int try_to_freeze_cgroup(struct c
freezer->state = STATE_FREEZING;
cgroup_iter_start(cgroup, &it);
while ((task = cgroup_iter_next(cgroup, &it))) {
if (!freeze_task(task, true))
continue;
- if (task_is_stopped_or_traced(task) && freezing(task))
- /*
- * The freeze flag is set so these tasks will
- * immediately go into the fridge upon waking.
- */
+ if (is_task_frozen_enough(task))
continue;
if (!freezing(task) && !freezer_should_skip(task))
num_cant_freeze_now++;
}
cgroup_iter_end(cgroup, &it);
--
^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH 6/6] Container Freezer: Use cgroup write_string method
2008-08-01 5:06 [PATCH 0/6] Container Freezer: Reuse Suspend Freezer Matt Helsley
` (4 preceding siblings ...)
2008-08-01 5:07 ` [PATCH 5/6] Container Freezer: Prevent frozen tasks or cgroups from changing Matt Helsley
@ 2008-08-01 5:07 ` Matt Helsley
2008-08-01 5:16 ` [PATCH 0/6] Container Freezer: Reuse Suspend Freezer Matt Helsley
6 siblings, 0 replies; 27+ messages in thread
From: Matt Helsley @ 2008-08-01 5:07 UTC (permalink / raw)
To: Andrew Morton
Cc: Rafael J. Wysocki, Paul Menage, Li Zefan, Linux-Kernel,
Linux Containers, linux-pm
Use the new cgroup write_string method rather than the raw write method
because it better matches the needs of the freezer cgroup subsystem.
Signed-off-by: Matt Helsley <matthltc@us.ibm.com>
---
kernel/cgroup_freezer.c | 21 +++++----------------
1 file changed, 5 insertions(+), 16 deletions(-)
Index: linux-2.6.27-rc1-mm1/kernel/cgroup_freezer.c
===================================================================
--- linux-2.6.27-rc1-mm1.orig/kernel/cgroup_freezer.c
+++ linux-2.6.27-rc1-mm1/kernel/cgroup_freezer.c
@@ -29,11 +29,10 @@
static const char *freezer_state_strs[] = {
"RUNNING",
"FREEZING",
"FROZEN",
};
-#define STATE_MAX_STRLEN 8
/*
* State diagram (transition labels in parenthesis):
*
* RUNNING -(FROZEN)-> FREEZING -(FROZEN)-> FROZEN
@@ -278,27 +277,17 @@ out:
spin_unlock_irq(&freezer->lock);
return retval;
}
-static ssize_t freezer_write(struct cgroup *cgroup,
- struct cftype *cft,
- struct file *file,
- const char __user *userbuf,
- size_t nbytes, loff_t *unused_ppos)
+static int freezer_write(struct cgroup *cgroup,
+ struct cftype *cft,
+ const char *buffer)
{
- char buffer[STATE_MAX_STRLEN + 1];
- int retval = 0;
+ int retval;
enum freezer_state goal_state;
- if (nbytes >= PATH_MAX)
- return -E2BIG;
- nbytes = min(sizeof(buffer) - 1, nbytes);
- if (copy_from_user(buffer, userbuf, nbytes))
- return -EFAULT;
- buffer[nbytes + 1] = 0; /* nul-terminate */
- strstrip(buffer); /* remove any trailing whitespace */
if (strcmp(buffer, freezer_state_strs[STATE_RUNNING]) == 0)
goal_state = STATE_RUNNING;
else if (strcmp(buffer, freezer_state_strs[STATE_FROZEN]) == 0)
goal_state = STATE_FROZEN;
else
@@ -313,11 +302,11 @@ static ssize_t freezer_write(struct cgro
static struct cftype files[] = {
{
.name = "state",
.read_seq_string = freezer_read,
- .write = freezer_write,
+ .write_string = freezer_write,
},
};
static int freezer_populate(struct cgroup_subsys *ss, struct cgroup *cgroup)
{
--
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 0/6] Container Freezer: Reuse Suspend Freezer
2008-08-01 5:06 [PATCH 0/6] Container Freezer: Reuse Suspend Freezer Matt Helsley
` (5 preceding siblings ...)
2008-08-01 5:07 ` [PATCH 6/6] Container Freezer: Use cgroup write_string method Matt Helsley
@ 2008-08-01 5:16 ` Matt Helsley
2008-08-01 13:04 ` Rafael J. Wysocki
6 siblings, 1 reply; 27+ messages in thread
From: Matt Helsley @ 2008-08-01 5:16 UTC (permalink / raw)
To: Andrew Morton
Cc: Rafael J. Wysocki, Paul Menage, Li Zefan, Linux-Kernel,
Linux Containers, linux-pm
On Thu, 2008-07-31 at 22:06 -0700, Matt Helsley wrote:
> This patch series introduces a cgroup subsystem that utilizes the swsusp
> freezer to freeze a group of tasks. It's immediately useful for batch job
> management scripts. It should also be useful in the future for implementing
> container checkpoint/restart.
<snip>
> Andrew, since I hear Rafael doesn't have time to review these (again) at this
> time, please consider these patches for -mm.
Argh -- that "(again)" is ripe for misinterpretation! Rafael has
reviewed and commented on these patches often in the past but, from what
I hear, lacks the time to do so now. Hence I'm sending these to -mm.
Sorry about the wording Rafael.
Cheers,
-Matt Helsley
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 4/6] Container Freezer: Skip frozen cgroups during power management resume
2008-08-01 5:07 ` [PATCH 4/6] Container Freezer: Skip frozen cgroups during power management resume Matt Helsley
@ 2008-08-01 10:24 ` Nigel Cunningham
0 siblings, 0 replies; 27+ messages in thread
From: Nigel Cunningham @ 2008-08-01 10:24 UTC (permalink / raw)
To: Matt Helsley
Cc: Andrew Morton, Rafael J. Wysocki, Paul Menage, Li Zefan,
Linux-Kernel, Linux Containers, linux-pm, Cedric Le Goater,
Serge E. Hallyn
Hi.
On Thu, 2008-07-31 at 22:07 -0700, Matt Helsley wrote:
> When a system is resumed after a suspend, it will also unfreeze
> frozen cgroups.
>
> This patchs modifies the resume sequence to skip the tasks which
> are part of a frozen control group.
>
> 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>
I understand the freezer pretty well, so maybe I can help a little.
Acked-by: Nigel Cunningham <nigel@tuxonice.net>
> ---
> kernel/power/process.c | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/kernel/power/process.c b/kernel/power/process.c
> index 444cea8..ce9e280 100644
> --- a/kernel/power/process.c
> +++ b/kernel/power/process.c
> @@ -13,6 +13,7 @@
> #include <linux/module.h>
> #include <linux/syscalls.h>
> #include <linux/freezer.h>
> +#include <linux/cgroup_freezer.h>
>
> /*
> * Timeout for stopping processes
> @@ -135,6 +136,9 @@ static void thaw_tasks(bool nosig_only)
> if (nosig_only && should_send_signal(p))
> continue;
>
> + if (cgroup_frozen(p))
> + continue;
> +
> thaw_process(p);
> } while_each_thread(g, p);
> read_unlock(&tasklist_lock);
> --
> 1.5.3.7
>
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 1/6] Container Freezer: Add TIF_FREEZE flag to all architectures
2008-08-01 5:07 ` [PATCH 1/6] Container Freezer: Add TIF_FREEZE flag to all architectures Matt Helsley
@ 2008-08-01 10:32 ` Nigel Cunningham
2008-08-01 12:32 ` Cedric Le Goater
0 siblings, 1 reply; 27+ messages in thread
From: Nigel Cunningham @ 2008-08-01 10:32 UTC (permalink / raw)
To: Matt Helsley
Cc: Andrew Morton, Rafael J. Wysocki, Paul Menage, Li Zefan,
Linux-Kernel, Linux Containers, linux-pm, Cedric Le Goater,
Pavel Machek, Serge E. Hallyn
Hi.
On Thu, 2008-07-31 at 22:07 -0700, Matt Helsley wrote:
> This patch is the first step in making the refrigerator() available
> to all architectures, even for those without power management.
>
> The purpose of such a change is to be able to use the refrigerator()
> in a new control group subsystem which will implement a control group
> freezer.
Is there a reason for always using 19, rather than just the next
available bit?
Regards,
Nigel
> Signed-off-by: Cedric Le Goater <clg@fr.ibm.com>
> Signed-off-by: Matt Helsley <matthltc@us.ibm.com>
> Acked-by: Pavel Machek <pavel@suse.cz>
> Acked-by: Serge E. Hallyn <serue@us.ibm.com>
> Tested-by: Matt Helsley <matthltc@us.ibm.com>
> ---
> arch/parisc/include/asm/thread_info.h | 2 ++
> arch/sparc/include/asm/thread_info_32.h | 2 ++
> arch/sparc/include/asm/thread_info_64.h | 2 ++
> include/asm-alpha/thread_info.h | 2 ++
> include/asm-avr32/thread_info.h | 1 +
> include/asm-cris/thread_info.h | 2 ++
> include/asm-h8300/thread_info.h | 2 ++
> include/asm-m68k/thread_info.h | 1 +
> include/asm-m68knommu/thread_info.h | 2 ++
> include/asm-s390/thread_info.h | 2 ++
> include/asm-um/thread_info.h | 2 ++
> include/asm-xtensa/thread_info.h | 2 ++
> 12 files changed, 22 insertions(+)
>
> Index: linux-2.6.27-rc1-mm1/arch/sparc/include/asm/thread_info_32.h
> ===================================================================
> --- linux-2.6.27-rc1-mm1.orig/arch/sparc/include/asm/thread_info_32.h
> +++ linux-2.6.27-rc1-mm1/arch/sparc/include/asm/thread_info_32.h
> @@ -137,10 +137,11 @@ BTFIXUPDEF_CALL(void, free_thread_info,
> #define TIF_USEDFPU 8 /* FPU was used by this task
> * this quantum (SMP) */
> #define TIF_POLLING_NRFLAG 9 /* true if poll_idle() is polling
> * TIF_NEED_RESCHED */
> #define TIF_MEMDIE 10
> +#define TIF_FREEZE 19 /* is freezing for suspend */
>
> /* as above, but as bit values */
> #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
> #define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
> #define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
> @@ -150,9 +151,10 @@ BTFIXUPDEF_CALL(void, free_thread_info,
> #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
>
> #define _TIF_DO_NOTIFY_RESUME_MASK (_TIF_NOTIFY_RESUME | \
> _TIF_SIGPENDING | \
> _TIF_RESTORE_SIGMASK)
> +#define TIF_FREEZE (1<<TIF_FREEZE)
>
> #endif /* __KERNEL__ */
>
> #endif /* _ASM_THREAD_INFO_H */
> Index: linux-2.6.27-rc1-mm1/arch/sparc/include/asm/thread_info_64.h
> ===================================================================
> --- linux-2.6.27-rc1-mm1.orig/arch/sparc/include/asm/thread_info_64.h
> +++ linux-2.6.27-rc1-mm1/arch/sparc/include/asm/thread_info_64.h
> @@ -235,10 +235,11 @@ register struct thread_info *current_thr
> * an immediate value in instructions such as andcc.
> */
> #define TIF_ABI_PENDING 12
> #define TIF_MEMDIE 13
> #define TIF_POLLING_NRFLAG 14
> +#define TIF_FREEZE 19 /* is freezing for suspend */
>
> #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
> #define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
> #define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
> #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
> @@ -247,10 +248,11 @@ register struct thread_info *current_thr
> #define _TIF_32BIT (1<<TIF_32BIT)
> #define _TIF_SECCOMP (1<<TIF_SECCOMP)
> #define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT)
> #define _TIF_ABI_PENDING (1<<TIF_ABI_PENDING)
> #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
> +#define _TIF_FREEZE (1<<TIF_FREEZE)
>
> #define _TIF_USER_WORK_MASK ((0xff << TI_FLAG_WSAVED_SHIFT) | \
> _TIF_DO_NOTIFY_RESUME_MASK | \
> _TIF_NEED_RESCHED | _TIF_PERFCTR)
> #define _TIF_DO_NOTIFY_RESUME_MASK (_TIF_NOTIFY_RESUME | _TIF_SIGPENDING)
> Index: linux-2.6.27-rc1-mm1/include/asm-alpha/thread_info.h
> ===================================================================
> --- linux-2.6.27-rc1-mm1.orig/include/asm-alpha/thread_info.h
> +++ linux-2.6.27-rc1-mm1/include/asm-alpha/thread_info.h
> @@ -72,16 +72,18 @@ register struct thread_info *__current_t
> #define TIF_UAC_NOPRINT 5 /* see sysinfo.h */
> #define TIF_UAC_NOFIX 6
> #define TIF_UAC_SIGBUS 7
> #define TIF_MEMDIE 8
> #define TIF_RESTORE_SIGMASK 9 /* restore signal mask in do_signal */
> +#define TIF_FREEZE 19 /* is freezing for suspend */
>
> #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
> #define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
> #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
> #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
> #define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
> +#define _TIF_FREEZE (1<<TIF_FREEZE)
>
> /* Work to do on interrupt/exception return. */
> #define _TIF_WORK_MASK (_TIF_SIGPENDING | _TIF_NEED_RESCHED)
>
> /* Work to do on any return to userspace. */
> Index: linux-2.6.27-rc1-mm1/include/asm-avr32/thread_info.h
> ===================================================================
> --- linux-2.6.27-rc1-mm1.orig/include/asm-avr32/thread_info.h
> +++ linux-2.6.27-rc1-mm1/include/asm-avr32/thread_info.h
> @@ -94,10 +94,11 @@ static inline struct thread_info *curren
> #define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
> #define _TIF_SINGLE_STEP (1 << TIF_SINGLE_STEP)
> #define _TIF_MEMDIE (1 << TIF_MEMDIE)
> #define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK)
> #define _TIF_CPU_GOING_TO_SLEEP (1 << TIF_CPU_GOING_TO_SLEEP)
> +#define _TIF_FREEZE (1 << TIF_FREEZE)
>
> /* Note: The masks below must never span more than 16 bits! */
>
> /* work to do on interrupt/exception return */
> #define _TIF_WORK_MASK \
> Index: linux-2.6.27-rc1-mm1/include/asm-cris/thread_info.h
> ===================================================================
> --- linux-2.6.27-rc1-mm1.orig/include/asm-cris/thread_info.h
> +++ linux-2.6.27-rc1-mm1/include/asm-cris/thread_info.h
> @@ -86,17 +86,19 @@ struct thread_info {
> #define TIF_SIGPENDING 2 /* signal pending */
> #define TIF_NEED_RESCHED 3 /* rescheduling necessary */
> #define TIF_RESTORE_SIGMASK 9 /* restore signal mask in do_signal() */
> #define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */
> #define TIF_MEMDIE 17
> +#define TIF_FREEZE 19 /* is freezing for suspend */
>
> #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
> #define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
> #define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
> #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
> #define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
> #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
> +#define _TIF_FREEZE (1<<TIF_FREEZE)
>
> #define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */
> #define _TIF_ALLWORK_MASK 0x0000FFFF /* work to do on any return to u-space */
>
> #endif /* __KERNEL__ */
> Index: linux-2.6.27-rc1-mm1/include/asm-h8300/thread_info.h
> ===================================================================
> --- linux-2.6.27-rc1-mm1.orig/include/asm-h8300/thread_info.h
> +++ linux-2.6.27-rc1-mm1/include/asm-h8300/thread_info.h
> @@ -87,17 +87,19 @@ static inline struct thread_info *curren
> #define TIF_NEED_RESCHED 2 /* rescheduling necessary */
> #define TIF_POLLING_NRFLAG 3 /* true if poll_idle() is polling
> TIF_NEED_RESCHED */
> #define TIF_MEMDIE 4
> #define TIF_RESTORE_SIGMASK 5 /* restore signal mask in do_signal() */
> +#define TIF_FREEZE 19 /* is freezing for suspend */
>
> /* as above, but as bit values */
> #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
> #define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
> #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
> #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
> #define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
> +#define _TIF_FREEZE (1<<TIF_FREEZE)
>
> #define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */
>
> #endif /* __KERNEL__ */
>
> Index: linux-2.6.27-rc1-mm1/include/asm-m68k/thread_info.h
> ===================================================================
> --- linux-2.6.27-rc1-mm1.orig/include/asm-m68k/thread_info.h
> +++ linux-2.6.27-rc1-mm1/include/asm-m68k/thread_info.h
> @@ -50,7 +50,8 @@ struct thread_info {
> #define TIF_SIGPENDING 6 /* signal pending */
> #define TIF_NEED_RESCHED 7 /* rescheduling necessary */
> #define TIF_DELAYED_TRACE 14 /* single step a syscall */
> #define TIF_SYSCALL_TRACE 15 /* syscall trace active */
> #define TIF_MEMDIE 16
> +#define TIF_FREEZE 19 /* thread is freezing for suspend */
>
> #endif /* _ASM_M68K_THREAD_INFO_H */
> Index: linux-2.6.27-rc1-mm1/include/asm-m68knommu/thread_info.h
> ===================================================================
> --- linux-2.6.27-rc1-mm1.orig/include/asm-m68knommu/thread_info.h
> +++ linux-2.6.27-rc1-mm1/include/asm-m68knommu/thread_info.h
> @@ -82,16 +82,18 @@ static inline struct thread_info *curren
> #define TIF_SIGPENDING 1 /* signal pending */
> #define TIF_NEED_RESCHED 2 /* rescheduling necessary */
> #define TIF_POLLING_NRFLAG 3 /* true if poll_idle() is polling
> TIF_NEED_RESCHED */
> #define TIF_MEMDIE 4
> +#define TIF_FREEZE 19 /* is freezing for suspend */
>
> /* as above, but as bit values */
> #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
> #define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
> #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
> #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
> +#define _TIF_FREEZE (1<<TIF_FREEZE)
>
> #define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */
>
> #endif /* __KERNEL__ */
>
> Index: linux-2.6.27-rc1-mm1/include/asm-s390/thread_info.h
> ===================================================================
> --- linux-2.6.27-rc1-mm1.orig/include/asm-s390/thread_info.h
> +++ linux-2.6.27-rc1-mm1/include/asm-s390/thread_info.h
> @@ -96,10 +96,11 @@ static inline struct thread_info *curren
> #define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling
> TIF_NEED_RESCHED */
> #define TIF_31BIT 18 /* 32bit process */
> #define TIF_MEMDIE 19
> #define TIF_RESTORE_SIGMASK 20 /* restore signal mask in do_signal() */
> +#define TIF_FREEZE 21 /* thread is freezing for suspend */
>
> #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
> #define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
> #define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
> #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
> @@ -108,10 +109,11 @@ static inline struct thread_info *curren
> #define _TIF_SINGLE_STEP (1<<TIF_SINGLE_STEP)
> #define _TIF_MCCK_PENDING (1<<TIF_MCCK_PENDING)
> #define _TIF_USEDFPU (1<<TIF_USEDFPU)
> #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
> #define _TIF_31BIT (1<<TIF_31BIT)
> +#define _TIF_FREEZE (1<<TIF_FREEZE)
>
> #endif /* __KERNEL__ */
>
> #define PREEMPT_ACTIVE 0x4000000
>
> Index: linux-2.6.27-rc1-mm1/include/asm-um/thread_info.h
> ===================================================================
> --- linux-2.6.27-rc1-mm1.orig/include/asm-um/thread_info.h
> +++ linux-2.6.27-rc1-mm1/include/asm-um/thread_info.h
> @@ -67,15 +67,17 @@ static inline struct thread_info *curren
> */
> #define TIF_RESTART_BLOCK 4
> #define TIF_MEMDIE 5
> #define TIF_SYSCALL_AUDIT 6
> #define TIF_RESTORE_SIGMASK 7
> +#define TIF_FREEZE 19 /* is freezing for suspend */
>
> #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
> #define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
> #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
> #define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
> #define _TIF_MEMDIE (1 << TIF_MEMDIE)
> #define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)
> #define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK)
> +#define _TIF_FREEZE (1 << TIF_FREEZE)
>
> #endif
> Index: linux-2.6.27-rc1-mm1/include/asm-xtensa/thread_info.h
> ===================================================================
> --- linux-2.6.27-rc1-mm1.orig/include/asm-xtensa/thread_info.h
> +++ linux-2.6.27-rc1-mm1/include/asm-xtensa/thread_info.h
> @@ -132,18 +132,20 @@ static inline struct thread_info *curren
> #define TIF_SINGLESTEP 3 /* restore singlestep on return to user mode */
> #define TIF_IRET 4 /* return with iret */
> #define TIF_MEMDIE 5
> #define TIF_RESTORE_SIGMASK 6 /* restore signal mask in do_signal() */
> #define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */
> +#define TIF_FREEZE 19 /* is freezing for suspend */
>
> #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
> #define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
> #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
> #define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP)
> #define _TIF_IRET (1<<TIF_IRET)
> #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
> #define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
> +#define _TIF_FREEZE (1<<TIF_FREEZE)
>
> #define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */
> #define _TIF_ALLWORK_MASK 0x0000FFFF /* work to do on any return to u-space */
>
> /*
> Index: linux-2.6.27-rc1-mm1/arch/parisc/include/asm/thread_info.h
> ===================================================================
> --- linux-2.6.27-rc1-mm1.orig/arch/parisc/include/asm/thread_info.h
> +++ linux-2.6.27-rc1-mm1/arch/parisc/include/asm/thread_info.h
> @@ -56,17 +56,19 @@ struct thread_info {
> #define TIF_NEED_RESCHED 2 /* rescheduling necessary */
> #define TIF_POLLING_NRFLAG 3 /* true if poll_idle() is polling TIF_NEED_RESCHED */
> #define TIF_32BIT 4 /* 32 bit binary */
> #define TIF_MEMDIE 5
> #define TIF_RESTORE_SIGMASK 6 /* restore saved signal mask */
> +#define TIF_FREEZE 19 /* is freezing for suspend */
>
> #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
> #define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
> #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
> #define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
> #define _TIF_32BIT (1 << TIF_32BIT)
> #define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK)
> +#define _TIF_FREEZE (1 << TIF_FREEZE)
>
> #define _TIF_USER_WORK_MASK (_TIF_SIGPENDING | \
> _TIF_NEED_RESCHED | _TIF_RESTORE_SIGMASK)
>
> #endif /* __KERNEL__ */
>
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 2/6] Container Freezer: Make refrigerator always available
2008-08-01 5:07 ` [PATCH 2/6] Container Freezer: Make refrigerator always available Matt Helsley
@ 2008-08-01 10:33 ` Nigel Cunningham
2008-08-01 14:27 ` Thomas Petazzoni
1 sibling, 0 replies; 27+ messages in thread
From: Nigel Cunningham @ 2008-08-01 10:33 UTC (permalink / raw)
To: Matt Helsley
Cc: Andrew Morton, Rafael J. Wysocki, Paul Menage, Li Zefan,
Linux-Kernel, Linux Containers, linux-pm, Cedric Le Goater,
Serge E. Hallyn
Hi.
On Thu, 2008-07-31 at 22:07 -0700, Matt Helsley wrote:
> Now that the TIF_FREEZE flag is available in all architectures,
> extract the refrigerator() and freeze_task() from kernel/power/process.c
> and make it available to all.
>
> The refrigerator() can now be used in a control group subsystem
> implementing a control group freezer.
>
> 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>
Acked-by: Nigel Cunningham <nigel@tuxonice.net>
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 1/6] Container Freezer: Add TIF_FREEZE flag to all architectures
2008-08-01 10:32 ` Nigel Cunningham
@ 2008-08-01 12:32 ` Cedric Le Goater
2008-08-01 22:05 ` Matt Helsley
0 siblings, 1 reply; 27+ messages in thread
From: Cedric Le Goater @ 2008-08-01 12:32 UTC (permalink / raw)
To: Nigel Cunningham
Cc: Matt Helsley, Andrew Morton, Rafael J. Wysocki, Paul Menage,
Li Zefan, Linux-Kernel, Linux Containers, linux-pm, Pavel Machek,
Serge E. Hallyn
Nigel Cunningham wrote:
> Hi.
>
> On Thu, 2008-07-31 at 22:07 -0700, Matt Helsley wrote:
>> This patch is the first step in making the refrigerator() available
>> to all architectures, even for those without power management.
>>
>> The purpose of such a change is to be able to use the refrigerator()
>> in a new control group subsystem which will implement a control group
>> freezer.
>
> Is there a reason for always using 19, rather than just the next
> available bit?
At the time I did the patch, it was to be consistent with the other
arches supporting suspend but this can not be true anymore. So we might
as well just use the next available bit as you suggest.
Thanks,
C.
> Regards,
>
> Nigel
>
>> Signed-off-by: Cedric Le Goater <clg@fr.ibm.com>
>> Signed-off-by: Matt Helsley <matthltc@us.ibm.com>
>> Acked-by: Pavel Machek <pavel@suse.cz>
>> Acked-by: Serge E. Hallyn <serue@us.ibm.com>
>> Tested-by: Matt Helsley <matthltc@us.ibm.com>
>> ---
>> arch/parisc/include/asm/thread_info.h | 2 ++
>> arch/sparc/include/asm/thread_info_32.h | 2 ++
>> arch/sparc/include/asm/thread_info_64.h | 2 ++
>> include/asm-alpha/thread_info.h | 2 ++
>> include/asm-avr32/thread_info.h | 1 +
>> include/asm-cris/thread_info.h | 2 ++
>> include/asm-h8300/thread_info.h | 2 ++
>> include/asm-m68k/thread_info.h | 1 +
>> include/asm-m68knommu/thread_info.h | 2 ++
>> include/asm-s390/thread_info.h | 2 ++
>> include/asm-um/thread_info.h | 2 ++
>> include/asm-xtensa/thread_info.h | 2 ++
>> 12 files changed, 22 insertions(+)
>>
>> Index: linux-2.6.27-rc1-mm1/arch/sparc/include/asm/thread_info_32.h
>> ===================================================================
>> --- linux-2.6.27-rc1-mm1.orig/arch/sparc/include/asm/thread_info_32.h
>> +++ linux-2.6.27-rc1-mm1/arch/sparc/include/asm/thread_info_32.h
>> @@ -137,10 +137,11 @@ BTFIXUPDEF_CALL(void, free_thread_info,
>> #define TIF_USEDFPU 8 /* FPU was used by this task
>> * this quantum (SMP) */
>> #define TIF_POLLING_NRFLAG 9 /* true if poll_idle() is polling
>> * TIF_NEED_RESCHED */
>> #define TIF_MEMDIE 10
>> +#define TIF_FREEZE 19 /* is freezing for suspend */
>>
>> /* as above, but as bit values */
>> #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
>> #define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
>> #define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
>> @@ -150,9 +151,10 @@ BTFIXUPDEF_CALL(void, free_thread_info,
>> #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
>>
>> #define _TIF_DO_NOTIFY_RESUME_MASK (_TIF_NOTIFY_RESUME | \
>> _TIF_SIGPENDING | \
>> _TIF_RESTORE_SIGMASK)
>> +#define TIF_FREEZE (1<<TIF_FREEZE)
>>
>> #endif /* __KERNEL__ */
>>
>> #endif /* _ASM_THREAD_INFO_H */
>> Index: linux-2.6.27-rc1-mm1/arch/sparc/include/asm/thread_info_64.h
>> ===================================================================
>> --- linux-2.6.27-rc1-mm1.orig/arch/sparc/include/asm/thread_info_64.h
>> +++ linux-2.6.27-rc1-mm1/arch/sparc/include/asm/thread_info_64.h
>> @@ -235,10 +235,11 @@ register struct thread_info *current_thr
>> * an immediate value in instructions such as andcc.
>> */
>> #define TIF_ABI_PENDING 12
>> #define TIF_MEMDIE 13
>> #define TIF_POLLING_NRFLAG 14
>> +#define TIF_FREEZE 19 /* is freezing for suspend */
>>
>> #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
>> #define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
>> #define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
>> #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
>> @@ -247,10 +248,11 @@ register struct thread_info *current_thr
>> #define _TIF_32BIT (1<<TIF_32BIT)
>> #define _TIF_SECCOMP (1<<TIF_SECCOMP)
>> #define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT)
>> #define _TIF_ABI_PENDING (1<<TIF_ABI_PENDING)
>> #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
>> +#define _TIF_FREEZE (1<<TIF_FREEZE)
>>
>> #define _TIF_USER_WORK_MASK ((0xff << TI_FLAG_WSAVED_SHIFT) | \
>> _TIF_DO_NOTIFY_RESUME_MASK | \
>> _TIF_NEED_RESCHED | _TIF_PERFCTR)
>> #define _TIF_DO_NOTIFY_RESUME_MASK (_TIF_NOTIFY_RESUME | _TIF_SIGPENDING)
>> Index: linux-2.6.27-rc1-mm1/include/asm-alpha/thread_info.h
>> ===================================================================
>> --- linux-2.6.27-rc1-mm1.orig/include/asm-alpha/thread_info.h
>> +++ linux-2.6.27-rc1-mm1/include/asm-alpha/thread_info.h
>> @@ -72,16 +72,18 @@ register struct thread_info *__current_t
>> #define TIF_UAC_NOPRINT 5 /* see sysinfo.h */
>> #define TIF_UAC_NOFIX 6
>> #define TIF_UAC_SIGBUS 7
>> #define TIF_MEMDIE 8
>> #define TIF_RESTORE_SIGMASK 9 /* restore signal mask in do_signal */
>> +#define TIF_FREEZE 19 /* is freezing for suspend */
>>
>> #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
>> #define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
>> #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
>> #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
>> #define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
>> +#define _TIF_FREEZE (1<<TIF_FREEZE)
>>
>> /* Work to do on interrupt/exception return. */
>> #define _TIF_WORK_MASK (_TIF_SIGPENDING | _TIF_NEED_RESCHED)
>>
>> /* Work to do on any return to userspace. */
>> Index: linux-2.6.27-rc1-mm1/include/asm-avr32/thread_info.h
>> ===================================================================
>> --- linux-2.6.27-rc1-mm1.orig/include/asm-avr32/thread_info.h
>> +++ linux-2.6.27-rc1-mm1/include/asm-avr32/thread_info.h
>> @@ -94,10 +94,11 @@ static inline struct thread_info *curren
>> #define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
>> #define _TIF_SINGLE_STEP (1 << TIF_SINGLE_STEP)
>> #define _TIF_MEMDIE (1 << TIF_MEMDIE)
>> #define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK)
>> #define _TIF_CPU_GOING_TO_SLEEP (1 << TIF_CPU_GOING_TO_SLEEP)
>> +#define _TIF_FREEZE (1 << TIF_FREEZE)
>>
>> /* Note: The masks below must never span more than 16 bits! */
>>
>> /* work to do on interrupt/exception return */
>> #define _TIF_WORK_MASK \
>> Index: linux-2.6.27-rc1-mm1/include/asm-cris/thread_info.h
>> ===================================================================
>> --- linux-2.6.27-rc1-mm1.orig/include/asm-cris/thread_info.h
>> +++ linux-2.6.27-rc1-mm1/include/asm-cris/thread_info.h
>> @@ -86,17 +86,19 @@ struct thread_info {
>> #define TIF_SIGPENDING 2 /* signal pending */
>> #define TIF_NEED_RESCHED 3 /* rescheduling necessary */
>> #define TIF_RESTORE_SIGMASK 9 /* restore signal mask in do_signal() */
>> #define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */
>> #define TIF_MEMDIE 17
>> +#define TIF_FREEZE 19 /* is freezing for suspend */
>>
>> #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
>> #define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
>> #define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
>> #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
>> #define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
>> #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
>> +#define _TIF_FREEZE (1<<TIF_FREEZE)
>>
>> #define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */
>> #define _TIF_ALLWORK_MASK 0x0000FFFF /* work to do on any return to u-space */
>>
>> #endif /* __KERNEL__ */
>> Index: linux-2.6.27-rc1-mm1/include/asm-h8300/thread_info.h
>> ===================================================================
>> --- linux-2.6.27-rc1-mm1.orig/include/asm-h8300/thread_info.h
>> +++ linux-2.6.27-rc1-mm1/include/asm-h8300/thread_info.h
>> @@ -87,17 +87,19 @@ static inline struct thread_info *curren
>> #define TIF_NEED_RESCHED 2 /* rescheduling necessary */
>> #define TIF_POLLING_NRFLAG 3 /* true if poll_idle() is polling
>> TIF_NEED_RESCHED */
>> #define TIF_MEMDIE 4
>> #define TIF_RESTORE_SIGMASK 5 /* restore signal mask in do_signal() */
>> +#define TIF_FREEZE 19 /* is freezing for suspend */
>>
>> /* as above, but as bit values */
>> #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
>> #define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
>> #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
>> #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
>> #define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
>> +#define _TIF_FREEZE (1<<TIF_FREEZE)
>>
>> #define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */
>>
>> #endif /* __KERNEL__ */
>>
>> Index: linux-2.6.27-rc1-mm1/include/asm-m68k/thread_info.h
>> ===================================================================
>> --- linux-2.6.27-rc1-mm1.orig/include/asm-m68k/thread_info.h
>> +++ linux-2.6.27-rc1-mm1/include/asm-m68k/thread_info.h
>> @@ -50,7 +50,8 @@ struct thread_info {
>> #define TIF_SIGPENDING 6 /* signal pending */
>> #define TIF_NEED_RESCHED 7 /* rescheduling necessary */
>> #define TIF_DELAYED_TRACE 14 /* single step a syscall */
>> #define TIF_SYSCALL_TRACE 15 /* syscall trace active */
>> #define TIF_MEMDIE 16
>> +#define TIF_FREEZE 19 /* thread is freezing for suspend */
>>
>> #endif /* _ASM_M68K_THREAD_INFO_H */
>> Index: linux-2.6.27-rc1-mm1/include/asm-m68knommu/thread_info.h
>> ===================================================================
>> --- linux-2.6.27-rc1-mm1.orig/include/asm-m68knommu/thread_info.h
>> +++ linux-2.6.27-rc1-mm1/include/asm-m68knommu/thread_info.h
>> @@ -82,16 +82,18 @@ static inline struct thread_info *curren
>> #define TIF_SIGPENDING 1 /* signal pending */
>> #define TIF_NEED_RESCHED 2 /* rescheduling necessary */
>> #define TIF_POLLING_NRFLAG 3 /* true if poll_idle() is polling
>> TIF_NEED_RESCHED */
>> #define TIF_MEMDIE 4
>> +#define TIF_FREEZE 19 /* is freezing for suspend */
>>
>> /* as above, but as bit values */
>> #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
>> #define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
>> #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
>> #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
>> +#define _TIF_FREEZE (1<<TIF_FREEZE)
>>
>> #define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */
>>
>> #endif /* __KERNEL__ */
>>
>> Index: linux-2.6.27-rc1-mm1/include/asm-s390/thread_info.h
>> ===================================================================
>> --- linux-2.6.27-rc1-mm1.orig/include/asm-s390/thread_info.h
>> +++ linux-2.6.27-rc1-mm1/include/asm-s390/thread_info.h
>> @@ -96,10 +96,11 @@ static inline struct thread_info *curren
>> #define TIF_POLLING_NRFLAG 17 /* true if poll_idle() is polling
>> TIF_NEED_RESCHED */
>> #define TIF_31BIT 18 /* 32bit process */
>> #define TIF_MEMDIE 19
>> #define TIF_RESTORE_SIGMASK 20 /* restore signal mask in do_signal() */
>> +#define TIF_FREEZE 21 /* thread is freezing for suspend */
>>
>> #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
>> #define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
>> #define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
>> #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
>> @@ -108,10 +109,11 @@ static inline struct thread_info *curren
>> #define _TIF_SINGLE_STEP (1<<TIF_SINGLE_STEP)
>> #define _TIF_MCCK_PENDING (1<<TIF_MCCK_PENDING)
>> #define _TIF_USEDFPU (1<<TIF_USEDFPU)
>> #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
>> #define _TIF_31BIT (1<<TIF_31BIT)
>> +#define _TIF_FREEZE (1<<TIF_FREEZE)
>>
>> #endif /* __KERNEL__ */
>>
>> #define PREEMPT_ACTIVE 0x4000000
>>
>> Index: linux-2.6.27-rc1-mm1/include/asm-um/thread_info.h
>> ===================================================================
>> --- linux-2.6.27-rc1-mm1.orig/include/asm-um/thread_info.h
>> +++ linux-2.6.27-rc1-mm1/include/asm-um/thread_info.h
>> @@ -67,15 +67,17 @@ static inline struct thread_info *curren
>> */
>> #define TIF_RESTART_BLOCK 4
>> #define TIF_MEMDIE 5
>> #define TIF_SYSCALL_AUDIT 6
>> #define TIF_RESTORE_SIGMASK 7
>> +#define TIF_FREEZE 19 /* is freezing for suspend */
>>
>> #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
>> #define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
>> #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
>> #define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
>> #define _TIF_MEMDIE (1 << TIF_MEMDIE)
>> #define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)
>> #define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK)
>> +#define _TIF_FREEZE (1 << TIF_FREEZE)
>>
>> #endif
>> Index: linux-2.6.27-rc1-mm1/include/asm-xtensa/thread_info.h
>> ===================================================================
>> --- linux-2.6.27-rc1-mm1.orig/include/asm-xtensa/thread_info.h
>> +++ linux-2.6.27-rc1-mm1/include/asm-xtensa/thread_info.h
>> @@ -132,18 +132,20 @@ static inline struct thread_info *curren
>> #define TIF_SINGLESTEP 3 /* restore singlestep on return to user mode */
>> #define TIF_IRET 4 /* return with iret */
>> #define TIF_MEMDIE 5
>> #define TIF_RESTORE_SIGMASK 6 /* restore signal mask in do_signal() */
>> #define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */
>> +#define TIF_FREEZE 19 /* is freezing for suspend */
>>
>> #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
>> #define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
>> #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
>> #define _TIF_SINGLESTEP (1<<TIF_SINGLESTEP)
>> #define _TIF_IRET (1<<TIF_IRET)
>> #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
>> #define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
>> +#define _TIF_FREEZE (1<<TIF_FREEZE)
>>
>> #define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */
>> #define _TIF_ALLWORK_MASK 0x0000FFFF /* work to do on any return to u-space */
>>
>> /*
>> Index: linux-2.6.27-rc1-mm1/arch/parisc/include/asm/thread_info.h
>> ===================================================================
>> --- linux-2.6.27-rc1-mm1.orig/arch/parisc/include/asm/thread_info.h
>> +++ linux-2.6.27-rc1-mm1/arch/parisc/include/asm/thread_info.h
>> @@ -56,17 +56,19 @@ struct thread_info {
>> #define TIF_NEED_RESCHED 2 /* rescheduling necessary */
>> #define TIF_POLLING_NRFLAG 3 /* true if poll_idle() is polling TIF_NEED_RESCHED */
>> #define TIF_32BIT 4 /* 32 bit binary */
>> #define TIF_MEMDIE 5
>> #define TIF_RESTORE_SIGMASK 6 /* restore saved signal mask */
>> +#define TIF_FREEZE 19 /* is freezing for suspend */
>>
>> #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
>> #define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
>> #define _TIF_NEED_RESCHED (1 << TIF_NEED_RESCHED)
>> #define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
>> #define _TIF_32BIT (1 << TIF_32BIT)
>> #define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK)
>> +#define _TIF_FREEZE (1 << TIF_FREEZE)
>>
>> #define _TIF_USER_WORK_MASK (_TIF_SIGPENDING | \
>> _TIF_NEED_RESCHED | _TIF_RESTORE_SIGMASK)
>>
>> #endif /* __KERNEL__ */
>>
>
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 0/6] Container Freezer: Reuse Suspend Freezer
2008-08-01 5:16 ` [PATCH 0/6] Container Freezer: Reuse Suspend Freezer Matt Helsley
@ 2008-08-01 13:04 ` Rafael J. Wysocki
0 siblings, 0 replies; 27+ messages in thread
From: Rafael J. Wysocki @ 2008-08-01 13:04 UTC (permalink / raw)
To: Matt Helsley
Cc: Andrew Morton, Paul Menage, Li Zefan, Linux-Kernel,
Linux Containers, linux-pm
On Friday, 1 of August 2008, Matt Helsley wrote:
>
> On Thu, 2008-07-31 at 22:06 -0700, Matt Helsley wrote:
> > This patch series introduces a cgroup subsystem that utilizes the swsusp
> > freezer to freeze a group of tasks. It's immediately useful for batch job
> > management scripts. It should also be useful in the future for implementing
> > container checkpoint/restart.
>
> <snip>
>
> > Andrew, since I hear Rafael doesn't have time to review these (again) at this
> > time, please consider these patches for -mm.
>
> Argh -- that "(again)" is ripe for misinterpretation! Rafael has
> reviewed and commented on these patches often in the past but, from what
> I hear, lacks the time to do so now. Hence I'm sending these to -mm.
>
> Sorry about the wording Rafael.
No problem.
If there are not too many new regressions reported today, I'll have a look at
the patches in the evening.
Thanks,
Rafael
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 2/6] Container Freezer: Make refrigerator always available
2008-08-01 5:07 ` [PATCH 2/6] Container Freezer: Make refrigerator always available Matt Helsley
2008-08-01 10:33 ` Nigel Cunningham
@ 2008-08-01 14:27 ` Thomas Petazzoni
2008-08-01 19:08 ` Matt Helsley
1 sibling, 1 reply; 27+ messages in thread
From: Thomas Petazzoni @ 2008-08-01 14:27 UTC (permalink / raw)
To: Matt Helsley
Cc: Andrew Morton, Rafael J. Wysocki, Paul Menage, Li Zefan,
Linux-Kernel, Linux Containers, linux-pm, Cedric Le Goater,
Serge E. Hallyn, Michael Opdenacker, linux-embedded
Hi,
Le Thu, 31 Jul 2008 22:07:01 -0700,
Matt Helsley <matthltc@us.ibm.com> a écrit :
> --- a/kernel/Makefile
> +++ b/kernel/Makefile
> @@ -5,7 +5,7 @@
> obj-y = sched.o fork.o exec_domain.o panic.o printk.o \
> cpu.o exit.o itimer.o time.o softirq.o resource.o \
> sysctl.o capability.o ptrace.o timer.o user.o \
> - signal.o sys.o kmod.o workqueue.o pid.o \
> + signal.o sys.o kmod.o workqueue.o pid.o freezer.o \
I have the impression that the code in kernel/power/process.c was
compiled only if CONFIG_PM_SLEEP was set. Now that the code has been
moved to kernel/freezer.c, it is unconditionnaly compiled in every
kernel. Is that correct ?
If so, is it possible to put this new feature under some
CONFIG_SOMETHING option, for people who care about the kernel size ?
Thanks,
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 2/6] Container Freezer: Make refrigerator always available
2008-08-01 14:27 ` Thomas Petazzoni
@ 2008-08-01 19:08 ` Matt Helsley
2008-08-01 22:53 ` Rafael J. Wysocki
2008-08-02 10:39 ` Thomas Petazzoni
0 siblings, 2 replies; 27+ messages in thread
From: Matt Helsley @ 2008-08-01 19:08 UTC (permalink / raw)
To: Thomas Petazzoni
Cc: Andrew Morton, Rafael J. Wysocki, Paul Menage, Li Zefan,
Linux-Kernel, Linux Containers, linux-pm, Cedric Le Goater,
Serge E. Hallyn, Michael Opdenacker, linux-embedded
On Fri, 2008-08-01 at 16:27 +0200, Thomas Petazzoni wrote:
> Hi,
>
> Le Thu, 31 Jul 2008 22:07:01 -0700,
> Matt Helsley <matthltc@us.ibm.com> a écrit :
>
> > --- a/kernel/Makefile
> > +++ b/kernel/Makefile
> > @@ -5,7 +5,7 @@
> > obj-y = sched.o fork.o exec_domain.o panic.o printk.o \
> > cpu.o exit.o itimer.o time.o softirq.o resource.o \
> > sysctl.o capability.o ptrace.o timer.o user.o \
> > - signal.o sys.o kmod.o workqueue.o pid.o \
> > + signal.o sys.o kmod.o workqueue.o pid.o freezer.o \
>
> I have the impression that the code in kernel/power/process.c was
> compiled only if CONFIG_PM_SLEEP was set. Now that the code has been
> moved to kernel/freezer.c, it is unconditionnaly compiled in every
> kernel. Is that correct ?
>
> If so, is it possible to put this new feature under some
> CONFIG_SOMETHING option, for people who care about the kernel size ?
How about making it depend on a combination of CONFIG variables?
Here's an RFC PATCH. Completely untested.
Signed-off-by: Matt Helsley <matthltc@us.ibm.com>
---
kernel/Makefile | 3 ++-
kernel/power/Kconfig | 3 +++
2 files changed, 5 insertions(+), 1 deletion(-)
Index: linux-2.6.27-rc1-mm1/kernel/Makefile
===================================================================
--- linux-2.6.27-rc1-mm1.orig/kernel/Makefile
+++ linux-2.6.27-rc1-mm1/kernel/Makefile
@@ -5,7 +5,7 @@
obj-y = sched.o fork.o exec_domain.o panic.o printk.o \
cpu.o exit.o itimer.o time.o softirq.o resource.o \
sysctl.o capability.o ptrace.o timer.o user.o \
- signal.o sys.o kmod.o workqueue.o pid.o freezer.o \
+ signal.o sys.o kmod.o workqueue.o pid.o \
rcupdate.o extable.o params.o posix-timers.o \
kthread.o wait.o kfifo.o sys_ni.o posix-cpu-timers.o mutex.o \
hrtimer.o rwsem.o nsproxy.o srcu.o semaphore.o \
@@ -24,6 +24,7 @@ CFLAGS_REMOVE_sched_clock.o = -pg
CFLAGS_REMOVE_sched.o = -mno-spe -pg
endif
+obj-$(CONFIG_FREEZER) += freezer.o
obj-$(CONFIG_PROFILING) += profile.o
obj-$(CONFIG_SYSCTL_SYSCALL_CHECK) += sysctl_check.o
obj-$(CONFIG_STACKTRACE) += stacktrace.o
Index: linux-2.6.27-rc1-mm1/kernel/power/Kconfig
===================================================================
--- linux-2.6.27-rc1-mm1.orig/kernel/power/Kconfig
+++ linux-2.6.27-rc1-mm1/kernel/power/Kconfig
@@ -85,6 +85,9 @@ config PM_SLEEP
depends on SUSPEND || HIBERNATION || XEN_SAVE_RESTORE
default y
+config FREEZER
+ def_bool PM_SLEEP || CGROUP_FREEZER
+
config SUSPEND
bool "Suspend to RAM and standby"
depends on PM && ARCH_SUSPEND_POSSIBLE
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 1/6] Container Freezer: Add TIF_FREEZE flag to all architectures
2008-08-01 12:32 ` Cedric Le Goater
@ 2008-08-01 22:05 ` Matt Helsley
2008-08-01 22:54 ` Rafael J. Wysocki
2008-08-02 1:13 ` Nigel Cunningham
0 siblings, 2 replies; 27+ messages in thread
From: Matt Helsley @ 2008-08-01 22:05 UTC (permalink / raw)
To: Cedric Le Goater
Cc: Nigel Cunningham, Andrew Morton, Rafael J. Wysocki, Paul Menage,
Li Zefan, Linux-Kernel, Linux Containers, linux-pm, Pavel Machek,
Serge E. Hallyn
On Fri, 2008-08-01 at 14:32 +0200, Cedric Le Goater wrote:
> Nigel Cunningham wrote:
> > Hi.
> >
> > On Thu, 2008-07-31 at 22:07 -0700, Matt Helsley wrote:
> >> This patch is the first step in making the refrigerator() available
> >> to all architectures, even for those without power management.
> >>
> >> The purpose of such a change is to be able to use the refrigerator()
> >> in a new control group subsystem which will implement a control group
> >> freezer.
> >
> > Is there a reason for always using 19, rather than just the next
> > available bit?
>
> At the time I did the patch, it was to be consistent with the other
> arches supporting suspend but this can not be true anymore. So we might
> as well just use the next available bit as you suggest.
>
> Thanks,
>
> C.
This is a good point.
I did a quick survey of the thread_info*.h headers. Most archs appear
to use the MSW/LSW to distinguish "pending work-to-be-done" (LSW) vs.
other flags (MSW). This explains most of the gaps in thread flag
assignment. In some other cases the bits are allocated based on whether
the arch asm code uses asm immediate values to test the flag. sparc64 is
by far the most elaborate and includes some excellent comments to
explain the situation.
The gaps in allocated flag bit assignments not explained in
thread_info*.h comments are:
mips doesn't use bit 0, there's a gap between 4 and 9, and another gap
between 24 and 31.
m32r has a gap between bit 4 and bit 8.
ia64 has a gap at bit 5.
blackfin doesn't explicitly mention the MSW/LSW distinction but appears
to follow it.
arm also doesn't mention MSW/LSW but appears consistent with that
explanation.
avr32 makes the MSW/LSW distinction but this doesn't fully explain
jumping from bit 8 to bit 30 unless they're allocating numbers in the
opposite direction within the MSW (highest flag is bit 31).
m68k starts at 6 and the comments don't explain why. At first glance it
doesn't appear to be because of m68knommu. It also jumps from bit 7 to
bit 14 without explanation and appears to not follow the MSW/LSW
convention.
cris has an inexplicable gap between bit 3 and bit 9.
s390 has a gap at bit 1. It appears to follow the MSW/LSW distinction
but doesn't mention it in a comment.
x86 has a gap at bit 9.
"sparc32" has a gap between 4 and 8.
So I've modified the flag numbers to follow apparent conventions of each
arch as best I can tell given the lack of explanation above.
------------
From: Cedric Le Goater <clg@fr.ibm.com>
Subject: Container Freezer: Add TIF_FREEZE flag to all architectures
This patch is the first step in making the refrigerator() available
to all architectures, even for those without power management.
The purpose of such a change is to be able to use the refrigerator()
in a new control group subsystem which will implement a control group
freezer.
Signed-off-by: Cedric Le Goater <clg@fr.ibm.com>
Signed-off-by: Matt Helsley <matthltc@us.ibm.com>
Acked-by: Pavel Machek <pavel@suse.cz>
Acked-by: Serge E. Hallyn <serue@us.ibm.com>
Tested-by: Matt Helsley <matthltc@us.ibm.com>
---
arch/parisc/include/asm/thread_info.h | 2 ++
arch/sparc/include/asm/thread_info_32.h | 2 ++
arch/sparc/include/asm/thread_info_64.h | 2 ++
include/asm-alpha/thread_info.h | 2 ++
include/asm-avr32/thread_info.h | 1 +
include/asm-cris/thread_info.h | 2 ++
include/asm-h8300/thread_info.h | 2 ++
include/asm-m68k/thread_info.h | 1 +
include/asm-m68knommu/thread_info.h | 2 ++
include/asm-s390/thread_info.h | 2 ++
include/asm-um/thread_info.h | 2 ++
include/asm-xtensa/thread_info.h | 2 ++
12 files changed, 22 insertions(+)
Index: linux-2.6.27-rc1-mm1/arch/sparc/include/asm/thread_info_32.h
===================================================================
--- linux-2.6.27-rc1-mm1.orig/arch/sparc/include/asm/thread_info_32.h
+++ linux-2.6.27-rc1-mm1/arch/sparc/include/asm/thread_info_32.h
@@ -139,6 +139,7 @@ BTFIXUPDEF_CALL(void, free_thread_info,
#define TIF_POLLING_NRFLAG 9 /* true if poll_idle() is polling
* TIF_NEED_RESCHED */
#define TIF_MEMDIE 10
+#define TIF_FREEZE 11 /* is freezing for suspend */
/* as above, but as bit values */
#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
@@ -152,6 +153,7 @@ BTFIXUPDEF_CALL(void, free_thread_info,
#define _TIF_DO_NOTIFY_RESUME_MASK (_TIF_NOTIFY_RESUME | \
_TIF_SIGPENDING | \
_TIF_RESTORE_SIGMASK)
+#define TIF_FREEZE (1<<TIF_FREEZE)
#endif /* __KERNEL__ */
Index: linux-2.6.27-rc1-mm1/arch/sparc/include/asm/thread_info_64.h
===================================================================
--- linux-2.6.27-rc1-mm1.orig/arch/sparc/include/asm/thread_info_64.h
+++ linux-2.6.27-rc1-mm1/arch/sparc/include/asm/thread_info_64.h
@@ -237,6 +237,7 @@ register struct thread_info *current_thr
#define TIF_ABI_PENDING 12
#define TIF_MEMDIE 13
#define TIF_POLLING_NRFLAG 14
+#define TIF_FREEZE 15 /* is freezing for suspend */
#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
@@ -249,6 +250,7 @@ register struct thread_info *current_thr
#define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT)
#define _TIF_ABI_PENDING (1<<TIF_ABI_PENDING)
#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
+#define _TIF_FREEZE (1<<TIF_FREEZE)
#define _TIF_USER_WORK_MASK ((0xff << TI_FLAG_WSAVED_SHIFT) | \
_TIF_DO_NOTIFY_RESUME_MASK | \
Index: linux-2.6.27-rc1-mm1/include/asm-alpha/thread_info.h
===================================================================
--- linux-2.6.27-rc1-mm1.orig/include/asm-alpha/thread_info.h
+++ linux-2.6.27-rc1-mm1/include/asm-alpha/thread_info.h
@@ -74,12 +74,14 @@ register struct thread_info *__current_t
#define TIF_UAC_SIGBUS 7
#define TIF_MEMDIE 8
#define TIF_RESTORE_SIGMASK 9 /* restore signal mask in do_signal */
+#define TIF_FREEZE 16 /* is freezing for suspend */
#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
+#define _TIF_FREEZE (1<<TIF_FREEZE)
/* Work to do on interrupt/exception return. */
#define _TIF_WORK_MASK (_TIF_SIGPENDING | _TIF_NEED_RESCHED)
Index: linux-2.6.27-rc1-mm1/include/asm-avr32/thread_info.h
===================================================================
--- linux-2.6.27-rc1-mm1.orig/include/asm-avr32/thread_info.h
+++ linux-2.6.27-rc1-mm1/include/asm-avr32/thread_info.h
@@ -96,6 +96,7 @@ static inline struct thread_info *curren
#define _TIF_MEMDIE (1 << TIF_MEMDIE)
#define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK)
#define _TIF_CPU_GOING_TO_SLEEP (1 << TIF_CPU_GOING_TO_SLEEP)
+#define _TIF_FREEZE (1 << TIF_FREEZE)
/* Note: The masks below must never span more than 16 bits! */
Index: linux-2.6.27-rc1-mm1/include/asm-cris/thread_info.h
===================================================================
--- linux-2.6.27-rc1-mm1.orig/include/asm-cris/thread_info.h
+++ linux-2.6.27-rc1-mm1/include/asm-cris/thread_info.h
@@ -88,6 +88,7 @@ struct thread_info {
#define TIF_RESTORE_SIGMASK 9 /* restore signal mask in do_signal() */
#define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */
#define TIF_MEMDIE 17
+#define TIF_FREEZE 18 /* is freezing for suspend */
#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
@@ -95,6 +96,7 @@ struct thread_info {
#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
+#define _TIF_FREEZE (1<<TIF_FREEZE)
#define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */
#define _TIF_ALLWORK_MASK 0x0000FFFF /* work to do on any return to u-space */
Index: linux-2.6.27-rc1-mm1/include/asm-h8300/thread_info.h
===================================================================
--- linux-2.6.27-rc1-mm1.orig/include/asm-h8300/thread_info.h
+++ linux-2.6.27-rc1-mm1/include/asm-h8300/thread_info.h
@@ -89,6 +89,7 @@ static inline struct thread_info *curren
TIF_NEED_RESCHED */
#define TIF_MEMDIE 4
#define TIF_RESTORE_SIGMASK 5 /* restore signal mask in do_signal() */
+#define TIF_FREEZE 16 /* is freezing for suspend */
/* as above, but as bit values */
#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
@@ -96,6 +97,7 @@ static inline struct thread_info *curren
#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
+#define _TIF_FREEZE (1<<TIF_FREEZE)
#define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */
Index: linux-2.6.27-rc1-mm1/include/asm-m68k/thread_info.h
===================================================================
--- linux-2.6.27-rc1-mm1.orig/include/asm-m68k/thread_info.h
+++ linux-2.6.27-rc1-mm1/include/asm-m68k/thread_info.h
@@ -52,5 +52,6 @@ struct thread_info {
#define TIF_DELAYED_TRACE 14 /* single step a syscall */
#define TIF_SYSCALL_TRACE 15 /* syscall trace active */
#define TIF_MEMDIE 16
+#define TIF_FREEZE 17 /* thread is freezing for suspend */
#endif /* _ASM_M68K_THREAD_INFO_H */
Index: linux-2.6.27-rc1-mm1/include/asm-m68knommu/thread_info.h
===================================================================
--- linux-2.6.27-rc1-mm1.orig/include/asm-m68knommu/thread_info.h
+++ linux-2.6.27-rc1-mm1/include/asm-m68knommu/thread_info.h
@@ -84,12 +84,14 @@ static inline struct thread_info *curren
#define TIF_POLLING_NRFLAG 3 /* true if poll_idle() is polling
TIF_NEED_RESCHED */
#define TIF_MEMDIE 4
+#define TIF_FREEZE 16 /* is freezing for suspend */
/* as above, but as bit values */
#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
+#define _TIF_FREEZE (1<<TIF_FREEZE)
#define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */
Index: linux-2.6.27-rc1-mm1/include/asm-s390/thread_info.h
===================================================================
--- linux-2.6.27-rc1-mm1.orig/include/asm-s390/thread_info.h
+++ linux-2.6.27-rc1-mm1/include/asm-s390/thread_info.h
@@ -98,6 +98,7 @@ static inline struct thread_info *curren
#define TIF_31BIT 18 /* 32bit process */
#define TIF_MEMDIE 19
#define TIF_RESTORE_SIGMASK 20 /* restore signal mask in do_signal() */
+#define TIF_FREEZE 21 /* thread is freezing for suspend */
#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
@@ -110,6 +111,7 @@ static inline struct thread_info *curren
#define _TIF_USEDFPU (1<<TIF_USEDFPU)
#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
#define _TIF_31BIT (1<<TIF_31BIT)
+#define _TIF_FREEZE (1<<TIF_FREEZE)
#endif /* __KERNEL__ */
Index: linux-2.6.27-rc1-mm1/include/asm-um/thread_info.h
===================================================================
--- linux-2.6.27-rc1-mm1.orig/include/asm-um/thread_info.h
+++ linux-2.6.27-rc1-mm1/include/asm-um/thread_info.h
@@ -69,6 +69,7 @@ static inline struct thread_info *curren
#define TIF_MEMDIE 5
#define TIF_SYSCALL_AUDIT 6
#define TIF_RESTORE_SIGMASK 7
+#define TIF_FREEZE 16 /* is freezing for suspend */
#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
@@ -77,5 +78,6 @@ static inline struct thread_info *curren
#define _TIF_MEMDIE (1 << TIF_MEMDIE)
#define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)
#define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK)
+#define _TIF_FREEZE (1 << TIF_FREEZE)
#endif
Index: linux-2.6.27-rc1-mm1/include/asm-xtensa/thread_info.h
===================================================================
--- linux-2.6.27-rc1-mm1.orig/include/asm-xtensa/thread_info.h
+++ linux-2.6.27-rc1-mm1/include/asm-xtensa/thread_info.h
@@ -134,6 +134,7 @@ static inline struct thread_info *curren
#define TIF_MEMDIE 5
#define TIF_RESTORE_SIGMASK 6 /* restore signal mask in do_signal() */
#define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */
+#define TIF_FREEZE 17 /* is freezing for suspend */
#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
@@ -142,6 +143,7 @@ static inline struct thread_info *curren
#define _TIF_IRET (1<<TIF_IRET)
#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
#define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
+#define _TIF_FREEZE (1<<TIF_FREEZE)
#define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */
#define _TIF_ALLWORK_MASK 0x0000FFFF /* work to do on any return to u-space */
Index: linux-2.6.27-rc1-mm1/arch/parisc/include/asm/thread_info.h
===================================================================
--- linux-2.6.27-rc1-mm1.orig/arch/parisc/include/asm/thread_info.h
+++ linux-2.6.27-rc1-mm1/arch/parisc/include/asm/thread_info.h
@@ -58,6 +58,7 @@ struct thread_info {
#define TIF_32BIT 4 /* 32 bit binary */
#define TIF_MEMDIE 5
#define TIF_RESTORE_SIGMASK 6 /* restore saved signal mask */
+#define TIF_FREEZE 7 /* is freezing for suspend */
#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
@@ -65,6 +66,7 @@ struct thread_info {
#define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
#define _TIF_32BIT (1 << TIF_32BIT)
#define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK)
+#define _TIF_FREEZE (1 << TIF_FREEZE)
#define _TIF_USER_WORK_MASK (_TIF_SIGPENDING | \
_TIF_NEED_RESCHED | _TIF_RESTORE_SIGMASK)
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 2/6] Container Freezer: Make refrigerator always available
2008-08-01 19:08 ` Matt Helsley
@ 2008-08-01 22:53 ` Rafael J. Wysocki
2008-08-01 23:24 ` Matt Helsley
2008-08-02 2:30 ` Matt Helsley
2008-08-02 10:39 ` Thomas Petazzoni
1 sibling, 2 replies; 27+ messages in thread
From: Rafael J. Wysocki @ 2008-08-01 22:53 UTC (permalink / raw)
To: Matt Helsley, Andrew Morton
Cc: Thomas Petazzoni, Paul Menage, Li Zefan, Linux-Kernel,
Linux Containers, linux-pm, Cedric Le Goater, Serge E. Hallyn,
Michael Opdenacker, linux-embedded
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-7", Size: 9506 bytes --]
On Friday, 1 of August 2008, Matt Helsley wrote:> > On Fri, 2008-08-01 at 16:27 +-0200, Thomas Petazzoni wrote:> > Hi,> > > > Le Thu, 31 Jul 2008 22:07:01 -0700,> > Matt Helsley <matthltc@us.ibm.com> a +AOk-crit :> > > > > --- a/kernel/Makefile> > > +-+-+- b/kernel/Makefile> > > @@ -5,7 +-5,7 @@> > > obj-y = sched.o fork.o exec_domain.o panic.o printk.o +AFw> > > cpu.o exit.o itimer.o time.o softirq.o resource.o +AFw> > > sysctl.o capability.o ptrace.o timer.o user.o +AFw> > > - signal.o sys.o kmod.o workqueue.o pid.o +AFw> > > +- signal.o sys.o kmod.o workqueue.o pid.o freezer.o +AFw> > > > I have the impression that the code in kernel/power/process.c was> > compiled only if CONFIG_PM_SLEEP was set. Now that the code has been> > moved to kernel/freezer.c, it is unconditionnaly compiled in every> > kernel. Is that correct ?> >> > If so, is it possible to put this new feature under some> > CONFIG_SOMETHING option, for people who care about the kernel size ?> > How about making it depend on a combination of CONFIG variables?> Here's an RFC PATCH. Completely untested.> > Signed-off-by: Matt Helsley <matthltc@us.ibm.com>
Can you please also make the contents of include/linux/freezer.h depend onCONFIG_FREEZER instead of CONFIG_PM_SLEEP?
Also, I'm not really sure if kernel/power/Kconfig is the right place to defineCONFIG_FREEZER.
Perhaps we should even move freezer.c from kernel/power to kerneland define CONFIG_FREEZER in Kconfig in there. Andrew, what do you think?
> ---> kernel/Makefile | 3 +-+--> kernel/power/Kconfig | 3 +-+-+-> 2 files changed, 5 insertions(+-), 1 deletion(-)> > Index: linux-2.6.27-rc1-mm1/kernel/Makefile> ===================================================================> --- linux-2.6.27-rc1-mm1.orig/kernel/Makefile> +-+-+- linux-2.6.27-rc1-mm1/kernel/Makefile> @@ -5,7 +-5,7 @@> obj-y = sched.o fork.o exec_domain.o panic.o printk.o +AFw> cpu.o exit.o itimer.o time.o softirq.o resource.o +AFw> sysctl.o capability.o ptrace.o timer.o user.o +AFw> - signal.o sys.o kmod.o workqueue.o pid.o freezer.o +AFw> +- signal.o sys.o kmod.o workqueue.o pid.o +AFw> rcupdate.o extable.o params.o posix-timers.o +AFw> kthread.o wait.o kfifo.o sys_ni.o posix-cpu-timers.o mutex.o +AFw> hrtimer.o rwsem.o nsproxy.o srcu.o semaphore.o +AFw> @@ -24,6 +-24,7 @@ CFLAGS_REMOVE_sched_clock.o = -pg> CFLAGS_REMOVE_sched.o = -mno-spe -pg> endif> > +-obj-$(CONFIG_FREEZER) +-= freezer.o> obj-$(CONFIG_PROFILING) +-= profile.o> obj-$(CONFIG_SYSCTL_SYSCALL_CHECK) +-= sysctl_check.o> obj-$(CONFIG_STACKTRACE) +-= stacktrace.o> Index: linux-2.6.27-rc1-mm1/kernel/power/Kconfig> ===================================================================> --- linux-2.6.27-rc1-mm1.orig/kernel/power/Kconfig> +-+-+- linux-2.6.27-rc1-mm1/kernel/power/Kconfig> @@ -85,6 +-85,9 @@ config PM_SLEEP> depends on SUSPEND || HIBERNATION || XEN_SAVE_RESTORE> default y> > +-config FREEZER> +- def_bool PM_SLEEP || CGROUP_FREEZER> +-> config SUSPEND> bool "Suspend to RAM and standby"> depends on PM && ARCH_SUSPEND_POSSIBLE> > > > >
\0^[¹þÿ\a°þÿ\0¦þÿ\0þÿ\0þÿ\0þÿ\0`âÿ \x1f#: \x1f#' \x1f#\x12 \x1f#\x05ÿÿÿ\0ÿÿÿ\0ÿÿÿ\0ÿÿÿ\0ÿÿÿ\0ÿÿÿ\0ýýûXÓÌÎÿýýüÿýýüÿÍÆÉÿýýûÿýýüÿýýûÿÑÊÍÿòîïÿýýüÿýýüÿþþýÿÔÍÐÿÕÏÒÿðèéÿöïïÿöïðÿöïïÿöïïÿͼ¿ÿn}ÿ\0Fÿ0µÿ8¡Õÿ@³îÿE¿úÿìþÿ@Íþÿ1Åþÿ\x1dºþÿ°þÿ\0«þÿ\0¢þÿ\0þÿ\0þÿ\0þÿ\0Zàÿ \x1f#A \x1f#/ \x1f#\x17 \x1f#\aÿÿÿ\0ÿÿÿ\0ÿÿÿ\0ÿÿÿ\0ÿÿÿ\0þþý\x06ýýûâÔÍÏÿüüúÿÎÇÊÿüûúÿüûúÿüûúÿüûúÿÒËÎÿóîîÿýýüÿÔÍÐÿÕÎÑÿõññÿùôôÿôìíÿõîïÿõíîÿôììÿíãäÿ©ÿ%rÿ\0-oÿ\0Kÿ7§Þÿ=·ôÿD¿üÿéþÿ4Åþÿ!¼þÿ\x0f´þÿ\0¬þÿ\0£þÿ\0þÿ\0þÿ\0þÿ\0\x7fþÿ\0Wâÿ \x1f#D \x1f#2 \x1f#\x19 \x1f#\bÿÿÿ\0ÿÿÿ\0ÿÿÿ\0ÿÿÿ\0ÿÿÿ\0üüúvÓÌÎÿñììÿüûúÿÏÇÊÿüûúÿüûúÿüûúÿüûúÿÓÌÏÿóîîÿÔÍÐÿôïðÿüûúÿöððÿòéêÿôìíÿôììÿòèèÿôììÿ¾«ÿp}ÿ!qÿ\06sÿ\09~ÿ\0\³ÿ:ºùÿ?¿þÿ
åþÿ%¿þÿ\x13¶þÿ\0¬þÿ\0¤þÿ\0þÿ\0þÿ\0þÿ\0þÿ\0zþÿ\0Sâÿ \x1f#D \x1f#3 \x1f#\x1a \x1f#\bÿÿÿ\0ÿÿÿ\0ÿÿÿ\0ÿÿÿ\0üüú\x15ÓÌÎùÖÏÑÿûúøÿÏÇÊÿûúøÿûúùÿûúøÿûúùÿûûùÿÓÌÏÿòíîÿýýûÿú÷öÿôìíÿñçèÿóêëÿòèéÿðååÿñèçÿáÔÕÿvxÿ\x1emÿ\x1fsÿ\07vÿ\0Fvÿ\0Gÿ\0gÉÿ;»þÿ{ßþÿ\x17¸þÿ\x03¬þÿ\0¥þÿ\0þÿ\0þÿ\0þÿ\0þÿ\0{þÿ\0rþÿ\0Pàÿ \x1f#D \x1f#3 \x1f#\x1a \x1f#\bÿÿÿ\0ÿÿÿ\0ÿÿÿ\0ÿÿÿ\0ûúøÔÍÏÿðêêÿúù÷ÿÏÇÊÿúø÷ÿúø÷ÿûúøÿûúøÿûúøÿÕÍÐÿòííÿöñðÿñçèÿñæçÿñçèÿñææÿîââÿðååÿñèçÿÿorÿ\x19mÿ\x1au¤ÿa§ÿ\0Dxÿ\0Zÿ\0P®ÿ\0kÎÿsÛþÿ\x05®þÿ\0¦þÿ\0þÿ\0þÿ\0þÿ\0
þÿ\0}þÿ\0tþÿ\0lþÿ\0Màÿ \x1f#D \x1f#3 \x1f#\x1a \x1f#\bÿÿÿ\0ÿÿÿ\0ÿÿÿ\0ûûø.ÔÍÏýÖÏÑÿúøöÿúøöÿúøöÿúøöÿúøöÿúø÷ÿúù÷ÿúù÷ÿÓÉÌÿéÝßÿïãäÿðåæÿðåæÿîââÿíààÿïããÿðæåÿàÓÓÿvxÿ\x16iÿ\x15oÿ\x19wªÿ\x19¿ÿr¦Äÿ\0Uÿ\0f³ÿ\0T¶ÿ\0tâÿ\0pâÿ\0lâÿ\0hâÿ\0dâÿ\0`àÿ\0Zâÿ\0Vâÿ\0Ràÿ\0Màÿ\0?Åÿ \x1f#D \x1f#3 \x1f#\x1a \x1f#\bÿÿÿ\0ÿÿÿ\0ÿÿÿ\0úùö½×ÐÒÿïêéÿúøöÿù÷õÿúøöÿúøöÿúøöÿúøöÿ÷òñÿòééÿÒÂÆÿå×ÙÿïãäÿîáâÿëÜÜÿìÞÞÿíßßÿîââÿïäãÿ¯ÿmoÿ\x11jÿ\x12p£ÿ\x14z±ÿ\x16Åÿ^[Ýÿ\x7f¼âÿ\0a³ÿ\0mÂÿ\0Úÿ\0Ýÿ\0éÿ\0òÿ\0úÿ\0þÿ\0þÿ\amÚÿLzw \x1f#J \x1f#H \x1f#> \x1f#. \x1f#\x17 \x1f#\bÿÿÿ\0ÿÿÿ\0ù÷õS×ÐÒÿúùöÿøöóÿù÷ôÿù÷ôÿù÷ôÿù÷õÿöðïÿñççÿíàáÿíàáÿνÁÿàÐÒÿêÚÚÿêÚÚÿêÜÛÿëÝÜÿíàßÿíáàÿÝÏÏÿuxÿ\x10hÿ\x0ejÿ\x0fr©ÿ\x13\x7f¹ÿ\x17Ëÿ\x1càÿ §ôÿÉóÿ\0kÅÿ\0~Úÿ\0\x7fâÿ\0
ìÿ\0òÿ\0üÿ\0þÿ\0þÿ\0iÚÿ\amÛÿOzt \x1f#? \x1f#3 \x1f#$ \x1f#\x11 \x1f#\x05ÿÿÿ\0÷õñ\x05÷õò׺°´ÿîçæÿøöóÿøõóÿöðïÿòêéÿïããÿëÜÝÿéÙÚÿèØÙÿè××ÿº¥©ÿÕÂÄÿéÙÙÿêÛÛÿêÜÛÿëÝÜÿìßÞÿíâàÿ®ÿjnÿ\x06fÿ\bk£ÿ u°ÿ\r¿ÿ\x10Ïÿ\x1aáÿ ©ôÿ+²ýÿÎüÿ\0xÚÿ\0zßÿ\0éÿ\0õÿ\0üÿ\0þÿ\0þÿ\0þÿ\0zìÿ\ajÜÿW®l \x1f#& \x1f#\x17 \x1f# \x1f#\x03ÿÿÿ\0öôð\x17¶©«üÁ·¹ÿ¾°³ÿ»ª®ÿº¦ªÿ²ÿ²ÿ®ÿ«ÿ«ÿ¤ÿ®ÿ¹¥©ÿÖÄÆÿéÚÙÿêÛÚÿëÝÜÿëÞÝÿìàÞÿÛÌÌÿtxÿ\x05hÿ\x01hÿ\x03n©ÿ\x05x¸ÿ\fÅÿ\x0eÒÿ\x18âÿ!«ôÿ/·ýÿ8¹þÿ¾ýþÿ¸øþÿ°õþÿ©òþÿ îþÿéþÿåþÿâþÿ\x7fÝþÿxÙþÿhÊþÿ \x1f#' \x1f#\x15 \x1f#\b \x1f#\x02ÿÿÿ\0*ѵÿ¤ÿ \x7fÿ¥ÿ¦ÿ§ÿº ¢ÿº ¢ÿÁ©«ÿì®ÿË·¸ÿÖÅÆÿ×ÇÇÿéÚÙÿêÛÚÿéÛÚÿêÞÜÿêÞÜÿÿg]|ÿ\0i¥ÿ\0h£ÿ\0q°ÿ\0{¾ÿ\x02Éÿ\bÒÿ\x14âÿ$©ôÿ4·ýÿ@¾þÿïþÿPÑþÿ?Ëþÿ-Áþÿ^[¹þÿ\a°þÿ\0¦þÿ\0þÿ\0þÿ\0þÿ\0`âÿ \x1f#0 \x1f#\x1d \x1f#\f \x1f#\x03ÿÿÿ\0 \x1f#\x01q\SØ
üÔÀÂÿÜÉÊÿÜÉÊÿÛÈÉÿÛÉÉÿÜÊÊÿÜÊÊÿ¸¤¨ÿÖÅÅÿÞÍÍÿÝÍÍÿÞÏÎÿèÚØÿèÚØÿéÜÚÿêÝÛÿ×ÉÈÿuvù\x051ÿ\0i©ÿ\0jªÿ\0r·ÿ\0}Äÿ\0Ìÿ\0Q¬ÿ\x14âÿ$«ôÿ2·ýÿFÀþÿìþÿ@Íþÿ1Åþÿ\x1dºþÿ°þÿ\0«þÿ\0¢þÿ\0þÿ\0þÿ\0þÿ\0Zàÿ \x1f#< \x1f#* \x1f#\x14 \x1f#\x06ÿÿÿ\0 \x1f#\x01Q;0dq\SæÓ¼¼ÿàÎÎÿßÍÍÿßÍÍÿßÍÍÿÞÍÌÿßÎÎÿ¶¤§ÿÕÄÄÿÞÎÍÿßÏÎÿçØ×ÿèÚØÿèÚØÿèÚØÿéÜÙÿ©ÿimÏ\00ÿ\0k¯ÿ\0m²ÿ\0t¾ÿ\0}Èÿ\0Ìÿ\04ÿ\0Q¯ÿ!©ôÿ4¸ýÿGÀþÿéþÿ4Åþÿ!¼þÿ\x0f´þÿ\0¬þÿ\0£þÿ\0þÿ\0þÿ\0þÿ\0\x7fþÿ\0Wâÿ \x1f#C \x1f#1 \x1f#\x18 \x1f#\bÿÿÿ\0\0\0\0\x01\x11\x11\x13\vV@5È£ýÖÄÄÿàÏÎÿáÐÏÿáÑÐÿãÒÑÿãÒÑÿ´¢¥ÿÓÃÃÿåÖÔÿçÙ×ÿæØÕÿæØÖÿæØÖÿæÙÖÿÔÅÄÿtuú+$&V\02ÿ\0m·ÿ\0p»ÿ\0xÄÿ\0|Ëÿ\0Íÿ\0;ÿ\05ÿ\0ZÄÿ8¸ýÿPÂþÿ
åþÿ%¿þÿ\x13¶þÿ\0¬þÿ\0¤þÿ\0þÿ\0þÿ\0þÿ\0þÿ\0zþÿ\0Sâÿ \x1f#D \x1f#3 \x1f#\x1a \x1f#\bÿÿÿ\0ÿÿÿ\0\x10\x10\x12\b\x0f\x0e\x10\x1cw_YêÔ¿¾ÿàÏÎÿàÑÏÿáÑÐÿàÑÏÿáÒÐÿµ£¥ÿÓÄÃÿäÕÓÿäÖÓÿäÖÓÿãÖÓÿãÖÓÿãÖÓÿ¦ÿloÒ\x1f\x1e"J\03ÿ\0p¿ÿ\0qÂÿ\0wÈÿ\0}Ëÿ\0Íÿ\0;ÿ\0=ÿ\0=«ÿ\0eÐÿTÇþÿ{ßþÿ\x17¸þÿ\x03¬þÿ\0¥þÿ\0þÿ\0þÿ\0þÿ\0þÿ\0{þÿ\0rþÿ\0Pàÿ \x1f#D \x1f#3 \x1f#\x1a \x1f#\bÿÿÿ\0ÿÿÿ\0\v\f\x03\x0f\x0f\x10\x11T?5¿ ýåÖÔÿßÐÎÿßÐÎÿßÐÎÿßÐÎÿ²¡£ÿÑÂÁÿãÕÒÿãÕÒÿãÕÒÿáÔÐÿàÓÏÿÑÂÀÿrrù,%'V\x1f\x1e"E\05¤ÿ\0qÈÿ\0rÉÿ\0wËÿ\0zÌÿ\0~ÍÿQÃÿ\0=ÿ\0L¸ÿ\0VËÿ\0lÖÿ\0xâÿ\0sâÿ\0oâÿ\0kâÿ\0fâÿ\0bâÿ\0[Öÿ\0Zâÿ\0Vâÿ\0Râÿ\0@Åÿ \x1f#D \x1f#3 \x1f#\x1a \x1f#\bÿÿÿ\0ÿÿÿ\0ÿÿÿ\0\x0e\r\x0f\a\r\r\x0e^[s[UéÒ¿½ÿÝÎÌÿÜÍÊÿÝÎÌÿÛÍÊÿ± ¡ÿ;½ÿàÒÎÿáÔÐÿÜÎËÿÞÐÍÿßÒÎÿ¥ÿkmÖ\x1c^[\x1fO\x1d\x1c\x1fB\03¥ÿ\0tÏÿ\0uÍÿ\0wËÿ\0zÌÿ\0~Íÿ\0Óÿf¬Úÿ\0L¼ÿ\0YÔÿ\0aßÿ\0zñÿ\0rñÿ\0töÿ\0}ýÿ\0þÿ\0þÿ\0pëÿ'çù \x1f#K \x1f#I \x1f#G \x1f#> \x1f#. \x1f#\x17 \x1f#\bÿÿÿ\0ÿÿÿ\0ÿÿÿ\0\x10\x10\x12\x02\x0e\r\x0f\x0eR=4¦ýãÕÑÿÛÍÊÿÚËÉÿÚÌÉÿ®ÿ˼ºÿÞÑÍÿÜÍÊÿÜÎÊÿÛÍÉÿÊ»¹ÿpoû!^[\x1dk\x16\x16\x19W1;Sa\r4þ\fcÒþ\0uÐÿ\0uÌÿ\0uÌÿ\0|Íÿ\0Óÿ\x14âÿr½óÿ\0[Öÿ\0bàÿ\0iëÿ\0põÿ\0vøÿ\0}þÿ\0þÿ\0þÿ\0oëÿ\x11lÙþ \x1f#I \x1f#C \x1f#; \x1f#0 \x1f#" \x1f#\x11 \x1f#\x05ÿÿÿ\0ÿÿÿ\0ÿÿÿ\0ÿÿÿ\0\r\f\x0e\x05\r\r\x0f\x18pZRåκ¸ÿÙËÈÿ×ÈÅÿÖÇÄÿ¬ÿȹ·ÿÙËÇÿÚËÇÿØÉÅÿØÉÅÿ¡ÿhiÝ\x12\x12\x14j\x12\x11\x13]\x0f\x0e\x10K-9S[\x116ý\v^Ìþ\0sÌÿ\0wÌÿ\0|Íÿ\0Óÿ\x17âÿ-«ôÿ~Ìýÿ\0bæÿ\0lïÿ\0röÿ\0xüÿ\0{þÿ\0þÿ\0þÿ\0þÿ\0þÿ\x1cqÙüQÏÏ \x1f#- \x1f#\x1f \x1f#\x13 \x1f# \x1f#\x03ÿÿÿ\0ÿÿÿ\0ÿÿÿ\0ÿÿÿ\0\x10\x10\x12\x02\r\r\x0f\fM:1~ýÊ»¹ÿÔÅÂÿÔÅÂÿ©ÿŶ´ÿØÉÅÿÔÅÁÿÓÅÀÿÄ´±ÿnmü^[\x17\x18v\x11\x10\x12i\x0f\x0e\x10[\v\fI\b\a\b?%/CV\x137ýZÇþ\0wÌÿ\0}Íÿ\x02Óÿ\x1aâÿ6±ôÿM¿ýÿ
Óþÿ\0môÿ\0r÷ÿ\0wþÿ\0~þÿ\0þÿ\0þÿ\0þÿ\0þÿ\0þÿ\x1cqÙü \x1f#* \x1f#\x19 \x1f#\f \x1f#\x05 \x1f#\x01ÿÿÿ\0ÿÿÿ\0ÿÿÿ\0ÿÿÿ\0ÿÿÿ\0\r\f\x0e\x05\r\r\x0e\x16jLDåɶ³ÿÒÿÿÐÁ¾ÿ¦ÿÁ²¯ÿÒÄ¿ÿѾÿÏÁ¼ÿÿefß\x11\x11\x13m\x10\x0f\x11c\r\r\x0eT\b\b C\x05\x04\x05:\x05\x05\x05<\x1d"1U\x169ý\bWÅÿ\0}Íÿ\0Óÿ\x1aâÿ:³ôÿ[ÇýÿvÑþÿ¾ýþÿ¸øþÿ°õþÿ©òþÿ îþÿéþÿåþÿâþÿ\x7fÝþÿxÙþÿhÊþÿ \x1f#! \x1f#\x10 \x1f#\x06 \x1f#\x01ÿÿÿ\0ÿÿÿ\0ÿÿÿ\0ÿÿÿ\0ÿÿÿ\0\0\0\0\x01\x0f\x0e\x10\vP71gb]þó±ÿ̼¸ÿ¢ÿ¼®«ÿÏÀ»ÿ̽¸ÿ¼¬¨ÿljý^[\x17\x18v\x11\x10\x12i\x0f\x0e\x10\
\vJ\x05\x05\x06<\x02\x01\x025\x02\x02\x036\x06\x06\x06=\x15\x19!O\x1a<ü\aVÃÿ\0Óÿ\x1eãÿ@µôÿbÊýÿ
ÚþÿïþÿPÑþÿ?Ëþÿ-Áþÿ^[¹þÿ\a°þÿ\0¦þÿ\0þÿ\0þÿ\0þÿ\0`âÿ \x1f#0 \x1f#\x1c \x1f#\f \x1f#\x03ÿÿÿ\0ÿÿÿ\0ÿÿÿ\0ÿÿÿ\0ÿÿÿ\0ÿÿÿ\0\x10\x10\x12\x04\x0e\r\x0f\x15fHAÌ®«ÿȸ´ÿ ÿºª§ÿȸ³ÿȹ³ÿ~ÿceß\x11\x11\x13m\x10\x10\x12d\r\r\x0eT\b\b C\x03\x03\x048\x01\x01\x013\x01\0\x013\x02\x02\x036\x06\x06\x06=\x16\x19"N\x1d@ú\x06YÌÿ\x1fæÿH¹öÿlÌýÿÝþÿìþÿ@Íþÿ1Åþÿ\x1dºþÿ°þÿ\0«þÿ\0¢þÿ\0þÿ\0þÿ\0þÿ\0Zàÿ \x1f#< \x1f#) \x1f#\x13 \x1f#\x05ÿÿÿ\0ÿÿÿ\0ÿÿÿ\0ÿÿÿ\0ÿÿÿ\0ÿÿÿ\0\0\0\0\x01\x0e\x0e\x10 8-':pQJþºª§ÿÿ´¤¡ÿô®ÿ´£ÿ{WSþ\x1d\x18\x18w\x11\x10\x12i\x0f\x0e\x10\
\vJ\x05\x05\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ÿÿÿ\0ÿÿÿ\0 \x1f#\x01\x1c^[\x1f\b\x1e\x1d!\x11 \x1f#\x16 \x1f#\x14 \x1f#\v \x1f#\x03ÿÿÿ\0ÿÿÿ\0ÿÿÿ\0 \x1f#\0 \x1f#\0 \x1f#\0 \x1f#\0 \x1f#\0 \x1f#\0 \x1f#\0 \x1f#\0 \x1f#\0 \x1f#\0 \x1f#\0 \x1f#\0 \x1f#\x02 \x1f#\x05 \x1f#\a \x1f#\b \x1f#\b \x1f#\b \x1f#\b \x1f#\b \x1f#\b \x1f#\b \x1f#\b \x1f#\b \x1f#\x05 \x1f#\x03 \x1f#\x01ÿÿÿ\0ÿÿÿ\0ÿÿÿ\0ÿÿÿ\0ÿÿÿ\0ÿÿÿ\0ÿÿÿ\0ÿÿÿ\0ÿÿÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 1/6] Container Freezer: Add TIF_FREEZE flag to all architectures
2008-08-01 22:05 ` Matt Helsley
@ 2008-08-01 22:54 ` Rafael J. Wysocki
2008-08-02 1:13 ` Nigel Cunningham
1 sibling, 0 replies; 27+ messages in thread
From: Rafael J. Wysocki @ 2008-08-01 22:54 UTC (permalink / raw)
To: Matt Helsley
Cc: Cedric Le Goater, Nigel Cunningham, Andrew Morton, Paul Menage,
Li Zefan, Linux-Kernel, Linux Containers, linux-pm, Pavel Machek,
Serge E. Hallyn
On Saturday, 2 of August 2008, Matt Helsley wrote:
>
> On Fri, 2008-08-01 at 14:32 +0200, Cedric Le Goater wrote:
> > Nigel Cunningham wrote:
> > > Hi.
> > >
> > > On Thu, 2008-07-31 at 22:07 -0700, Matt Helsley wrote:
> > >> This patch is the first step in making the refrigerator() available
> > >> to all architectures, even for those without power management.
> > >>
> > >> The purpose of such a change is to be able to use the refrigerator()
> > >> in a new control group subsystem which will implement a control group
> > >> freezer.
> > >
> > > Is there a reason for always using 19, rather than just the next
> > > available bit?
> >
> > At the time I did the patch, it was to be consistent with the other
> > arches supporting suspend but this can not be true anymore. So we might
> > as well just use the next available bit as you suggest.
> >
> > Thanks,
> >
> > C.
>
> This is a good point.
>
> I did a quick survey of the thread_info*.h headers. Most archs appear
> to use the MSW/LSW to distinguish "pending work-to-be-done" (LSW) vs.
> other flags (MSW). This explains most of the gaps in thread flag
> assignment. In some other cases the bits are allocated based on whether
> the arch asm code uses asm immediate values to test the flag. sparc64 is
> by far the most elaborate and includes some excellent comments to
> explain the situation.
>
> The gaps in allocated flag bit assignments not explained in
> thread_info*.h comments are:
>
> mips doesn't use bit 0, there's a gap between 4 and 9, and another gap
> between 24 and 31.
>
> m32r has a gap between bit 4 and bit 8.
>
> ia64 has a gap at bit 5.
>
> blackfin doesn't explicitly mention the MSW/LSW distinction but appears
> to follow it.
>
> arm also doesn't mention MSW/LSW but appears consistent with that
> explanation.
>
> avr32 makes the MSW/LSW distinction but this doesn't fully explain
> jumping from bit 8 to bit 30 unless they're allocating numbers in the
> opposite direction within the MSW (highest flag is bit 31).
>
> m68k starts at 6 and the comments don't explain why. At first glance it
> doesn't appear to be because of m68knommu. It also jumps from bit 7 to
> bit 14 without explanation and appears to not follow the MSW/LSW
> convention.
>
> cris has an inexplicable gap between bit 3 and bit 9.
>
> s390 has a gap at bit 1. It appears to follow the MSW/LSW distinction
> but doesn't mention it in a comment.
>
> x86 has a gap at bit 9.
>
> "sparc32" has a gap between 4 and 8.
>
> So I've modified the flag numbers to follow apparent conventions of each
> arch as best I can tell given the lack of explanation above.
> ------------
> From: Cedric Le Goater <clg@fr.ibm.com>
> Subject: Container Freezer: Add TIF_FREEZE flag to all architectures
>
> This patch is the first step in making the refrigerator() available
> to all architectures, even for those without power management.
>
> The purpose of such a change is to be able to use the refrigerator()
> in a new control group subsystem which will implement a control group
> freezer.
>
> Signed-off-by: Cedric Le Goater <clg@fr.ibm.com>
> Signed-off-by: Matt Helsley <matthltc@us.ibm.com>
> Acked-by: Pavel Machek <pavel@suse.cz>
> Acked-by: Serge E. Hallyn <serue@us.ibm.com>
> Tested-by: Matt Helsley <matthltc@us.ibm.com>
Acked-by: Rafael J. Wysocki <rjw@sisk.pl>
> ---
> arch/parisc/include/asm/thread_info.h | 2 ++
> arch/sparc/include/asm/thread_info_32.h | 2 ++
> arch/sparc/include/asm/thread_info_64.h | 2 ++
> include/asm-alpha/thread_info.h | 2 ++
> include/asm-avr32/thread_info.h | 1 +
> include/asm-cris/thread_info.h | 2 ++
> include/asm-h8300/thread_info.h | 2 ++
> include/asm-m68k/thread_info.h | 1 +
> include/asm-m68knommu/thread_info.h | 2 ++
> include/asm-s390/thread_info.h | 2 ++
> include/asm-um/thread_info.h | 2 ++
> include/asm-xtensa/thread_info.h | 2 ++
> 12 files changed, 22 insertions(+)
>
> Index: linux-2.6.27-rc1-mm1/arch/sparc/include/asm/thread_info_32.h
> ===================================================================
> --- linux-2.6.27-rc1-mm1.orig/arch/sparc/include/asm/thread_info_32.h
> +++ linux-2.6.27-rc1-mm1/arch/sparc/include/asm/thread_info_32.h
> @@ -139,6 +139,7 @@ BTFIXUPDEF_CALL(void, free_thread_info,
> #define TIF_POLLING_NRFLAG 9 /* true if poll_idle() is polling
> * TIF_NEED_RESCHED */
> #define TIF_MEMDIE 10
> +#define TIF_FREEZE 11 /* is freezing for suspend */
>
> /* as above, but as bit values */
> #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
> @@ -152,6 +153,7 @@ BTFIXUPDEF_CALL(void, free_thread_info,
> #define _TIF_DO_NOTIFY_RESUME_MASK (_TIF_NOTIFY_RESUME | \
> _TIF_SIGPENDING | \
> _TIF_RESTORE_SIGMASK)
> +#define TIF_FREEZE (1<<TIF_FREEZE)
>
> #endif /* __KERNEL__ */
>
> Index: linux-2.6.27-rc1-mm1/arch/sparc/include/asm/thread_info_64.h
> ===================================================================
> --- linux-2.6.27-rc1-mm1.orig/arch/sparc/include/asm/thread_info_64.h
> +++ linux-2.6.27-rc1-mm1/arch/sparc/include/asm/thread_info_64.h
> @@ -237,6 +237,7 @@ register struct thread_info *current_thr
> #define TIF_ABI_PENDING 12
> #define TIF_MEMDIE 13
> #define TIF_POLLING_NRFLAG 14
> +#define TIF_FREEZE 15 /* is freezing for suspend */
>
> #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
> #define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
> @@ -249,6 +250,7 @@ register struct thread_info *current_thr
> #define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT)
> #define _TIF_ABI_PENDING (1<<TIF_ABI_PENDING)
> #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
> +#define _TIF_FREEZE (1<<TIF_FREEZE)
>
> #define _TIF_USER_WORK_MASK ((0xff << TI_FLAG_WSAVED_SHIFT) | \
> _TIF_DO_NOTIFY_RESUME_MASK | \
> Index: linux-2.6.27-rc1-mm1/include/asm-alpha/thread_info.h
> ===================================================================
> --- linux-2.6.27-rc1-mm1.orig/include/asm-alpha/thread_info.h
> +++ linux-2.6.27-rc1-mm1/include/asm-alpha/thread_info.h
> @@ -74,12 +74,14 @@ register struct thread_info *__current_t
> #define TIF_UAC_SIGBUS 7
> #define TIF_MEMDIE 8
> #define TIF_RESTORE_SIGMASK 9 /* restore signal mask in do_signal */
> +#define TIF_FREEZE 16 /* is freezing for suspend */
>
> #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
> #define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
> #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
> #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
> #define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
> +#define _TIF_FREEZE (1<<TIF_FREEZE)
>
> /* Work to do on interrupt/exception return. */
> #define _TIF_WORK_MASK (_TIF_SIGPENDING | _TIF_NEED_RESCHED)
> Index: linux-2.6.27-rc1-mm1/include/asm-avr32/thread_info.h
> ===================================================================
> --- linux-2.6.27-rc1-mm1.orig/include/asm-avr32/thread_info.h
> +++ linux-2.6.27-rc1-mm1/include/asm-avr32/thread_info.h
> @@ -96,6 +96,7 @@ static inline struct thread_info *curren
> #define _TIF_MEMDIE (1 << TIF_MEMDIE)
> #define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK)
> #define _TIF_CPU_GOING_TO_SLEEP (1 << TIF_CPU_GOING_TO_SLEEP)
> +#define _TIF_FREEZE (1 << TIF_FREEZE)
>
> /* Note: The masks below must never span more than 16 bits! */
>
> Index: linux-2.6.27-rc1-mm1/include/asm-cris/thread_info.h
> ===================================================================
> --- linux-2.6.27-rc1-mm1.orig/include/asm-cris/thread_info.h
> +++ linux-2.6.27-rc1-mm1/include/asm-cris/thread_info.h
> @@ -88,6 +88,7 @@ struct thread_info {
> #define TIF_RESTORE_SIGMASK 9 /* restore signal mask in do_signal() */
> #define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */
> #define TIF_MEMDIE 17
> +#define TIF_FREEZE 18 /* is freezing for suspend */
>
> #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
> #define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
> @@ -95,6 +96,7 @@ struct thread_info {
> #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
> #define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
> #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
> +#define _TIF_FREEZE (1<<TIF_FREEZE)
>
> #define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */
> #define _TIF_ALLWORK_MASK 0x0000FFFF /* work to do on any return to u-space */
> Index: linux-2.6.27-rc1-mm1/include/asm-h8300/thread_info.h
> ===================================================================
> --- linux-2.6.27-rc1-mm1.orig/include/asm-h8300/thread_info.h
> +++ linux-2.6.27-rc1-mm1/include/asm-h8300/thread_info.h
> @@ -89,6 +89,7 @@ static inline struct thread_info *curren
> TIF_NEED_RESCHED */
> #define TIF_MEMDIE 4
> #define TIF_RESTORE_SIGMASK 5 /* restore signal mask in do_signal() */
> +#define TIF_FREEZE 16 /* is freezing for suspend */
>
> /* as above, but as bit values */
> #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
> @@ -96,6 +97,7 @@ static inline struct thread_info *curren
> #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
> #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
> #define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
> +#define _TIF_FREEZE (1<<TIF_FREEZE)
>
> #define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */
>
> Index: linux-2.6.27-rc1-mm1/include/asm-m68k/thread_info.h
> ===================================================================
> --- linux-2.6.27-rc1-mm1.orig/include/asm-m68k/thread_info.h
> +++ linux-2.6.27-rc1-mm1/include/asm-m68k/thread_info.h
> @@ -52,5 +52,6 @@ struct thread_info {
> #define TIF_DELAYED_TRACE 14 /* single step a syscall */
> #define TIF_SYSCALL_TRACE 15 /* syscall trace active */
> #define TIF_MEMDIE 16
> +#define TIF_FREEZE 17 /* thread is freezing for suspend */
>
> #endif /* _ASM_M68K_THREAD_INFO_H */
> Index: linux-2.6.27-rc1-mm1/include/asm-m68knommu/thread_info.h
> ===================================================================
> --- linux-2.6.27-rc1-mm1.orig/include/asm-m68knommu/thread_info.h
> +++ linux-2.6.27-rc1-mm1/include/asm-m68knommu/thread_info.h
> @@ -84,12 +84,14 @@ static inline struct thread_info *curren
> #define TIF_POLLING_NRFLAG 3 /* true if poll_idle() is polling
> TIF_NEED_RESCHED */
> #define TIF_MEMDIE 4
> +#define TIF_FREEZE 16 /* is freezing for suspend */
>
> /* as above, but as bit values */
> #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
> #define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
> #define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
> #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
> +#define _TIF_FREEZE (1<<TIF_FREEZE)
>
> #define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */
>
> Index: linux-2.6.27-rc1-mm1/include/asm-s390/thread_info.h
> ===================================================================
> --- linux-2.6.27-rc1-mm1.orig/include/asm-s390/thread_info.h
> +++ linux-2.6.27-rc1-mm1/include/asm-s390/thread_info.h
> @@ -98,6 +98,7 @@ static inline struct thread_info *curren
> #define TIF_31BIT 18 /* 32bit process */
> #define TIF_MEMDIE 19
> #define TIF_RESTORE_SIGMASK 20 /* restore signal mask in do_signal() */
> +#define TIF_FREEZE 21 /* thread is freezing for suspend */
>
> #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
> #define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
> @@ -110,6 +111,7 @@ static inline struct thread_info *curren
> #define _TIF_USEDFPU (1<<TIF_USEDFPU)
> #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
> #define _TIF_31BIT (1<<TIF_31BIT)
> +#define _TIF_FREEZE (1<<TIF_FREEZE)
>
> #endif /* __KERNEL__ */
>
> Index: linux-2.6.27-rc1-mm1/include/asm-um/thread_info.h
> ===================================================================
> --- linux-2.6.27-rc1-mm1.orig/include/asm-um/thread_info.h
> +++ linux-2.6.27-rc1-mm1/include/asm-um/thread_info.h
> @@ -69,6 +69,7 @@ static inline struct thread_info *curren
> #define TIF_MEMDIE 5
> #define TIF_SYSCALL_AUDIT 6
> #define TIF_RESTORE_SIGMASK 7
> +#define TIF_FREEZE 16 /* is freezing for suspend */
>
> #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
> #define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
> @@ -77,5 +78,6 @@ static inline struct thread_info *curren
> #define _TIF_MEMDIE (1 << TIF_MEMDIE)
> #define _TIF_SYSCALL_AUDIT (1 << TIF_SYSCALL_AUDIT)
> #define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK)
> +#define _TIF_FREEZE (1 << TIF_FREEZE)
>
> #endif
> Index: linux-2.6.27-rc1-mm1/include/asm-xtensa/thread_info.h
> ===================================================================
> --- linux-2.6.27-rc1-mm1.orig/include/asm-xtensa/thread_info.h
> +++ linux-2.6.27-rc1-mm1/include/asm-xtensa/thread_info.h
> @@ -134,6 +134,7 @@ static inline struct thread_info *curren
> #define TIF_MEMDIE 5
> #define TIF_RESTORE_SIGMASK 6 /* restore signal mask in do_signal() */
> #define TIF_POLLING_NRFLAG 16 /* true if poll_idle() is polling TIF_NEED_RESCHED */
> +#define TIF_FREEZE 17 /* is freezing for suspend */
>
> #define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
> #define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
> @@ -142,6 +143,7 @@ static inline struct thread_info *curren
> #define _TIF_IRET (1<<TIF_IRET)
> #define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
> #define _TIF_RESTORE_SIGMASK (1<<TIF_RESTORE_SIGMASK)
> +#define _TIF_FREEZE (1<<TIF_FREEZE)
>
> #define _TIF_WORK_MASK 0x0000FFFE /* work to do on interrupt/exception return */
> #define _TIF_ALLWORK_MASK 0x0000FFFF /* work to do on any return to u-space */
> Index: linux-2.6.27-rc1-mm1/arch/parisc/include/asm/thread_info.h
> ===================================================================
> --- linux-2.6.27-rc1-mm1.orig/arch/parisc/include/asm/thread_info.h
> +++ linux-2.6.27-rc1-mm1/arch/parisc/include/asm/thread_info.h
> @@ -58,6 +58,7 @@ struct thread_info {
> #define TIF_32BIT 4 /* 32 bit binary */
> #define TIF_MEMDIE 5
> #define TIF_RESTORE_SIGMASK 6 /* restore saved signal mask */
> +#define TIF_FREEZE 7 /* is freezing for suspend */
>
> #define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
> #define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
> @@ -65,6 +66,7 @@ struct thread_info {
> #define _TIF_POLLING_NRFLAG (1 << TIF_POLLING_NRFLAG)
> #define _TIF_32BIT (1 << TIF_32BIT)
> #define _TIF_RESTORE_SIGMASK (1 << TIF_RESTORE_SIGMASK)
> +#define _TIF_FREEZE (1 << TIF_FREEZE)
>
> #define _TIF_USER_WORK_MASK (_TIF_SIGPENDING | \
> _TIF_NEED_RESCHED | _TIF_RESTORE_SIGMASK)
>
>
>
>
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 3/6] Container Freezer: Implement freezer cgroup subsystem
2008-08-01 5:07 ` [PATCH 3/6] Container Freezer: Implement freezer cgroup subsystem Matt Helsley
@ 2008-08-01 22:58 ` Rafael J. Wysocki
2008-08-02 0:11 ` Matt Helsley
0 siblings, 1 reply; 27+ messages in thread
From: Rafael J. Wysocki @ 2008-08-01 22:58 UTC (permalink / raw)
To: Matt Helsley
Cc: Andrew Morton, Paul Menage, Li Zefan, Linux-Kernel,
Linux Containers, linux-pm, Cedric Le Goater, Serge E. Hallyn
On Friday, 1 of August 2008, Matt Helsley wrote:
> 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.
>
> 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>
> ---
> include/linux/cgroup_freezer.h | 71 ++++++++
> include/linux/cgroup_subsys.h | 6
> include/linux/freezer.h | 16 +-
> init/Kconfig | 7
> kernel/Makefile | 1
> kernel/cgroup_freezer.c | 328 +++++++++++++++++++++++++++++++++++++++++
> 6 files changed, 425 insertions(+), 4 deletions(-)
> create mode 100644 include/linux/cgroup_freezer.h
> create mode 100644 kernel/cgroup_freezer.c
>
> Index: linux-2.6.27-rc1-mm1/include/linux/cgroup_freezer.h
> ===================================================================
> --- /dev/null
> +++ linux-2.6.27-rc1-mm1/include/linux/cgroup_freezer.h
> @@ -0,0 +1,71 @@
> +#ifndef _LINUX_CGROUP_FREEZER_H
> +#define _LINUX_CGROUP_FREEZER_H
> +/*
> + * cgroup_freezer.h - control group freezer subsystem interface
> + *
> + * Copyright IBM Corporation, 2007
> + *
> + * Author : Cedric Le Goater <clg@fr.ibm.com>
> + *
> + * This program is free software; you can redistribute it and/or modify it
> + * under the terms of version 2.1 of the GNU Lesser General Public License
> + * as published by the Free Software Foundation.
> + *
> + * This program is distributed in the hope that it would be useful, but
> + * WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> + */
> +
> +#include <linux/cgroup.h>
> +
> +#ifdef CONFIG_CGROUP_FREEZER
> +
> +enum freezer_state {
> + STATE_RUNNING = 0,
> + STATE_FREEZING,
> + STATE_FROZEN,
> +};
> +
> +struct freezer {
> + struct cgroup_subsys_state css;
> + enum freezer_state state;
> + spinlock_t lock; /* protects _writes_ to state */
> +};
> +
> +static inline struct freezer *cgroup_freezer(
> + struct cgroup *cgroup)
> +{
> + return container_of(
> + cgroup_subsys_state(cgroup, freezer_subsys_id),
> + struct freezer, css);
> +}
> +
> +static inline struct freezer *task_freezer(struct task_struct *task)
> +{
> + return container_of(task_subsys_state(task, freezer_subsys_id),
> + struct freezer, css);
> +}
> +
> +static inline int cgroup_frozen(struct task_struct *task)
> +{
> + struct freezer *freezer;
> + enum freezer_state state;
> +
> + task_lock(task);
> + freezer = task_freezer(task);
> + state = freezer->state;
> + task_unlock(task);
> +
> + return state == STATE_FROZEN;
> +}
> +
> +#else /* !CONFIG_CGROUP_FREEZER */
> +
> +static inline int cgroup_frozen(struct task_struct *task)
> +{
> + return 0;
> +}
> +
> +#endif /* !CONFIG_CGROUP_FREEZER */
> +
> +#endif /* _LINUX_CGROUP_FREEZER_H */
Hmm. I wonder if we really need a separate file for this. I'd prefer it to be
in freezer.h, unless there's a good reason not to place it in there.
Thanks,
Rafael
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 2/6] Container Freezer: Make refrigerator always available
2008-08-01 22:53 ` Rafael J. Wysocki
@ 2008-08-01 23:24 ` Matt Helsley
2008-08-02 14:34 ` Rafael J. Wysocki
2008-08-02 2:30 ` Matt Helsley
1 sibling, 1 reply; 27+ messages in thread
From: Matt Helsley @ 2008-08-01 23:24 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Andrew Morton, Thomas Petazzoni, Paul Menage, Li Zefan,
Linux-Kernel, Linux Containers, linux-pm, Cedric Le Goater,
Serge E. Hallyn, Michael Opdenacker, linux-embedded
On Sat, 2008-08-02 at 00:53 +0200, Rafael J. Wysocki wrote:
> On Friday, 1 of August 2008, Matt Helsley wrote:
> >
> > On Fri, 2008-08-01 at 16:27 +0200, Thomas Petazzoni wrote:
> > > Hi,
> > >
> > > Le Thu, 31 Jul 2008 22:07:01 -0700,
> > > Matt Helsley <matthltc@us.ibm.com> a écrit :
> > >
> > > > --- a/kernel/Makefile
> > > > +++ b/kernel/Makefile
> > > > @@ -5,7 +5,7 @@
> > > > obj-y = sched.o fork.o exec_domain.o panic.o printk.o \
> > > > cpu.o exit.o itimer.o time.o softirq.o resource.o \
> > > > sysctl.o capability.o ptrace.o timer.o user.o \
> > > > - signal.o sys.o kmod.o workqueue.o pid.o \
> > > > + signal.o sys.o kmod.o workqueue.o pid.o freezer.o \
> > >
> > > I have the impression that the code in kernel/power/process.c was
> > > compiled only if CONFIG_PM_SLEEP was set. Now that the code has been
> > > moved to kernel/freezer.c, it is unconditionnaly compiled in every
> > > kernel. Is that correct ?
> > >
> > > If so, is it possible to put this new feature under some
> > > CONFIG_SOMETHING option, for people who care about the kernel size ?
> >
> > How about making it depend on a combination of CONFIG variables?
> > Here's an RFC PATCH. Completely untested.
> >
> > Signed-off-by: Matt Helsley <matthltc@us.ibm.com>
>
> Can you please also make the contents of include/linux/freezer.h depend on
> CONFIG_FREEZER instead of CONFIG_PM_SLEEP?
Good point -- I'll add that to this patch and repost.
> Also, I'm not really sure if kernel/power/Kconfig is the right place to define
> CONFIG_FREEZER.
There's no nice place to put it since we're dealing with CONFIG_
variables in two different Kconfig files. I put it in
kernel/power/Kconfig because I wasn't certain Kbuild would do the right
thing if I referenced PM_SLEEP from init/Kconfig.
> Perhaps we should even move freezer.c from kernel/power to kernel
It's already there. Perhaps you meant something else
(kernel/power/process.c?)?
> and define CONFIG_FREEZER in Kconfig in there. Andrew, what do you think?
The Kconfig files in kernel/ are Kconfig.hz and Kconfig.preemt which
don't seem appropriate. I suppose we could add another (perhaps
Kconfig.cgroup).
Thanks for the review!
Cheers,
-Matt
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 3/6] Container Freezer: Implement freezer cgroup subsystem
2008-08-01 22:58 ` Rafael J. Wysocki
@ 2008-08-02 0:11 ` Matt Helsley
2008-08-02 7:38 ` Cedric Le Goater
0 siblings, 1 reply; 27+ messages in thread
From: Matt Helsley @ 2008-08-02 0:11 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Andrew Morton, Paul Menage, Li Zefan, Linux-Kernel,
Linux Containers, linux-pm, Cedric Le Goater, Serge E. Hallyn
On Sat, 2008-08-02 at 00:58 +0200, Rafael J. Wysocki wrote:
> On Friday, 1 of August 2008, Matt Helsley wrote:
> > 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.
> >
> > 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>
> > ---
> > include/linux/cgroup_freezer.h | 71 ++++++++
> > include/linux/cgroup_subsys.h | 6
> > include/linux/freezer.h | 16 +-
> > init/Kconfig | 7
> > kernel/Makefile | 1
> > kernel/cgroup_freezer.c | 328 +++++++++++++++++++++++++++++++++++++++++
> > 6 files changed, 425 insertions(+), 4 deletions(-)
> > create mode 100644 include/linux/cgroup_freezer.h
> > create mode 100644 kernel/cgroup_freezer.c
> >
> > Index: linux-2.6.27-rc1-mm1/include/linux/cgroup_freezer.h
> > ===================================================================
> > --- /dev/null
> > +++ linux-2.6.27-rc1-mm1/include/linux/cgroup_freezer.h
> > @@ -0,0 +1,71 @@
> > +#ifndef _LINUX_CGROUP_FREEZER_H
> > +#define _LINUX_CGROUP_FREEZER_H
> > +/*
> > + * cgroup_freezer.h - control group freezer subsystem interface
> > + *
> > + * Copyright IBM Corporation, 2007
> > + *
> > + * Author : Cedric Le Goater <clg@fr.ibm.com>
> > + *
> > + * This program is free software; you can redistribute it and/or modify it
> > + * under the terms of version 2.1 of the GNU Lesser General Public License
> > + * as published by the Free Software Foundation.
> > + *
> > + * This program is distributed in the hope that it would be useful, but
> > + * WITHOUT ANY WARRANTY; without even the implied warranty of
> > + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> > + */
> > +
> > +#include <linux/cgroup.h>
> > +
> > +#ifdef CONFIG_CGROUP_FREEZER
> > +
> > +enum freezer_state {
> > + STATE_RUNNING = 0,
> > + STATE_FREEZING,
> > + STATE_FROZEN,
> > +};
> > +
> > +struct freezer {
> > + struct cgroup_subsys_state css;
> > + enum freezer_state state;
> > + spinlock_t lock; /* protects _writes_ to state */
> > +};
> > +
> > +static inline struct freezer *cgroup_freezer(
> > + struct cgroup *cgroup)
> > +{
> > + return container_of(
> > + cgroup_subsys_state(cgroup, freezer_subsys_id),
> > + struct freezer, css);
> > +}
> > +
> > +static inline struct freezer *task_freezer(struct task_struct *task)
> > +{
> > + return container_of(task_subsys_state(task, freezer_subsys_id),
> > + struct freezer, css);
> > +}
> > +
> > +static inline int cgroup_frozen(struct task_struct *task)
> > +{
> > + struct freezer *freezer;
> > + enum freezer_state state;
> > +
> > + task_lock(task);
> > + freezer = task_freezer(task);
> > + state = freezer->state;
> > + task_unlock(task);
> > +
> > + return state == STATE_FROZEN;
> > +}
> > +
> > +#else /* !CONFIG_CGROUP_FREEZER */
> > +
> > +static inline int cgroup_frozen(struct task_struct *task)
> > +{
> > + return 0;
> > +}
> > +
> > +#endif /* !CONFIG_CGROUP_FREEZER */
> > +
> > +#endif /* _LINUX_CGROUP_FREEZER_H */
>
> Hmm. I wonder if we really need a separate file for this. I'd prefer it to be
> in freezer.h, unless there's a good reason not to place it in there.
Yeah, it's a pretty small header so combining it with another header
would be nice. However if we combine it with freezer.h we'd be including
cgroup.h in unrelated filesystem code. An alternative might be to put it
into a cgroup header for "small" subsystems (which might just be
cgroup.h for now..).
Thanks for the review!
Cheers,
-Matt
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 1/6] Container Freezer: Add TIF_FREEZE flag to all architectures
2008-08-01 22:05 ` Matt Helsley
2008-08-01 22:54 ` Rafael J. Wysocki
@ 2008-08-02 1:13 ` Nigel Cunningham
1 sibling, 0 replies; 27+ messages in thread
From: Nigel Cunningham @ 2008-08-02 1:13 UTC (permalink / raw)
To: Matt Helsley
Cc: Cedric Le Goater, Andrew Morton, Rafael J. Wysocki, Paul Menage,
Li Zefan, Linux-Kernel, Linux Containers, linux-pm, Pavel Machek,
Serge E. Hallyn
Hi.
Please add my ack-ed by too:
Acked-by: Nigel Cunningham <nigel@tuxonice.net>
Regards,
Nigel
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 2/6] Container Freezer: Make refrigerator always available
2008-08-01 22:53 ` Rafael J. Wysocki
2008-08-01 23:24 ` Matt Helsley
@ 2008-08-02 2:30 ` Matt Helsley
1 sibling, 0 replies; 27+ messages in thread
From: Matt Helsley @ 2008-08-02 2:30 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Andrew Morton, Thomas Petazzoni, Paul Menage, Li Zefan,
Linux-Kernel, Linux Containers, linux-pm, Cedric Le Goater,
Serge E. Hallyn, Michael Opdenacker, linux-embedded
On Sat, 2008-08-02 at 00:53 +0200, Rafael J. Wysocki wrote:
> On Friday, 1 of August 2008, Matt Helsley wrote:
> >
> > On Fri, 2008-08-01 at 16:27 +0200, Thomas Petazzoni wrote:
> > > Hi,
> > >
> > > Le Thu, 31 Jul 2008 22:07:01 -0700,
> > > Matt Helsley <matthltc@us.ibm.com> a écrit :
> > >
> > > > --- a/kernel/Makefile
> > > > +++ b/kernel/Makefile
> > > > @@ -5,7 +5,7 @@
> > > > obj-y = sched.o fork.o exec_domain.o panic.o printk.o \
> > > > cpu.o exit.o itimer.o time.o softirq.o resource.o \
> > > > sysctl.o capability.o ptrace.o timer.o user.o \
> > > > - signal.o sys.o kmod.o workqueue.o pid.o \
> > > > + signal.o sys.o kmod.o workqueue.o pid.o freezer.o \
> > >
> > > I have the impression that the code in kernel/power/process.c was
> > > compiled only if CONFIG_PM_SLEEP was set. Now that the code has been
> > > moved to kernel/freezer.c, it is unconditionnaly compiled in every
> > > kernel. Is that correct ?
> > >
> > > If so, is it possible to put this new feature under some
> > > CONFIG_SOMETHING option, for people who care about the kernel size ?
> >
> > How about making it depend on a combination of CONFIG variables?
> > Here's an RFC PATCH. Completely untested.
> >
> > Signed-off-by: Matt Helsley <matthltc@us.ibm.com>
>
> Can you please also make the contents of include/linux/freezer.h depend on
> CONFIG_FREEZER instead of CONFIG_PM_SLEEP?
Done.
> Also, I'm not really sure if kernel/power/Kconfig is the right place to define
> CONFIG_FREEZER.
>
> Perhaps we should even move freezer.c from kernel/power to kernel
> and define CONFIG_FREEZER in Kconfig in there. Andrew, what do you think?
I'll check this weekend for replies and repost the RFC PATCH on Monday
if I don't hear anything. In the meantime I'll be doing some config
build testing with the above changes to make sure it's correct.
Cheers,
-Matt
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 3/6] Container Freezer: Implement freezer cgroup subsystem
2008-08-02 0:11 ` Matt Helsley
@ 2008-08-02 7:38 ` Cedric Le Goater
2008-08-02 14:37 ` Rafael J. Wysocki
0 siblings, 1 reply; 27+ messages in thread
From: Cedric Le Goater @ 2008-08-02 7:38 UTC (permalink / raw)
To: Matt Helsley
Cc: Rafael J. Wysocki, Andrew Morton, Paul Menage, Li Zefan,
Linux-Kernel, Linux Containers, linux-pm, Serge E. Hallyn
Matt Helsley wrote:
> On Sat, 2008-08-02 at 00:58 +0200, Rafael J. Wysocki wrote:
>> On Friday, 1 of August 2008, Matt Helsley wrote:
>>> 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.
>>>
>>> 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>
>>> ---
>>> include/linux/cgroup_freezer.h | 71 ++++++++
>>> include/linux/cgroup_subsys.h | 6
>>> include/linux/freezer.h | 16 +-
>>> init/Kconfig | 7
>>> kernel/Makefile | 1
>>> kernel/cgroup_freezer.c | 328 +++++++++++++++++++++++++++++++++++++++++
>>> 6 files changed, 425 insertions(+), 4 deletions(-)
>>> create mode 100644 include/linux/cgroup_freezer.h
>>> create mode 100644 kernel/cgroup_freezer.c
>>>
>>> Index: linux-2.6.27-rc1-mm1/include/linux/cgroup_freezer.h
>>> ===================================================================
>>> --- /dev/null
>>> +++ linux-2.6.27-rc1-mm1/include/linux/cgroup_freezer.h
>>> @@ -0,0 +1,71 @@
>>> +#ifndef _LINUX_CGROUP_FREEZER_H
>>> +#define _LINUX_CGROUP_FREEZER_H
>>> +/*
>>> + * cgroup_freezer.h - control group freezer subsystem interface
>>> + *
>>> + * Copyright IBM Corporation, 2007
>>> + *
>>> + * Author : Cedric Le Goater <clg@fr.ibm.com>
>>> + *
>>> + * This program is free software; you can redistribute it and/or modify it
>>> + * under the terms of version 2.1 of the GNU Lesser General Public License
>>> + * as published by the Free Software Foundation.
>>> + *
>>> + * This program is distributed in the hope that it would be useful, but
>>> + * WITHOUT ANY WARRANTY; without even the implied warranty of
>>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
>>> + */
>>> +
>>> +#include <linux/cgroup.h>
>>> +
>>> +#ifdef CONFIG_CGROUP_FREEZER
>>> +
>>> +enum freezer_state {
>>> + STATE_RUNNING = 0,
>>> + STATE_FREEZING,
>>> + STATE_FROZEN,
>>> +};
>>> +
>>> +struct freezer {
>>> + struct cgroup_subsys_state css;
>>> + enum freezer_state state;
>>> + spinlock_t lock; /* protects _writes_ to state */
>>> +};
>>> +
>>> +static inline struct freezer *cgroup_freezer(
>>> + struct cgroup *cgroup)
>>> +{
>>> + return container_of(
>>> + cgroup_subsys_state(cgroup, freezer_subsys_id),
>>> + struct freezer, css);
>>> +}
>>> +
>>> +static inline struct freezer *task_freezer(struct task_struct *task)
>>> +{
>>> + return container_of(task_subsys_state(task, freezer_subsys_id),
>>> + struct freezer, css);
>>> +}
>>> +
>>> +static inline int cgroup_frozen(struct task_struct *task)
>>> +{
>>> + struct freezer *freezer;
>>> + enum freezer_state state;
>>> +
>>> + task_lock(task);
>>> + freezer = task_freezer(task);
>>> + state = freezer->state;
>>> + task_unlock(task);
>>> +
>>> + return state == STATE_FROZEN;
>>> +}
>>> +
>>> +#else /* !CONFIG_CGROUP_FREEZER */
>>> +
>>> +static inline int cgroup_frozen(struct task_struct *task)
>>> +{
>>> + return 0;
>>> +}
>>> +
>>> +#endif /* !CONFIG_CGROUP_FREEZER */
>>> +
>>> +#endif /* _LINUX_CGROUP_FREEZER_H */
>> Hmm. I wonder if we really need a separate file for this. I'd prefer it to be
>> in freezer.h, unless there's a good reason not to place it in there.
>
> Yeah, it's a pretty small header so combining it with another header
> would be nice. However if we combine it with freezer.h we'd be including
> cgroup.h in unrelated filesystem code. An alternative might be to put it
> into a cgroup header for "small" subsystems (which might just be
> cgroup.h for now..).
>
> Thanks for the review!
I'm not sure the inline is really useful. In that case, we could probably do
something like the following :
include/linux/freezer.h :
#ifdef CONFIG_CGROUP_FREEZER
extern int cgroup_frozen(struct task_struct *task);
#else /* !CONFIG_CGROUP_FREEZER */
static inline int cgroup_frozen(struct task_struct *task)
{
return 0;
}
#endif /* !CONFIG_CGROUP_FREEZER */
and in kernel/cgroup_freezer.c:
int cgroup_frozen(struct task_struct *task)
{
struct freezer *freezer;
enum freezer_state state;
task_lock(task);
freezer = task_freezer(task);
state = freezer->state;
task_unlock(task);
return state == STATE_FROZEN;
}
and kill include/linux/cgroup_freezer.h ?
Thanks Matt,
C.
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 2/6] Container Freezer: Make refrigerator always available
2008-08-01 19:08 ` Matt Helsley
2008-08-01 22:53 ` Rafael J. Wysocki
@ 2008-08-02 10:39 ` Thomas Petazzoni
1 sibling, 0 replies; 27+ messages in thread
From: Thomas Petazzoni @ 2008-08-02 10:39 UTC (permalink / raw)
To: Matt Helsley
Cc: Andrew Morton, Rafael J. Wysocki, Paul Menage, Li Zefan,
Linux-Kernel, Linux Containers, linux-pm, Cedric Le Goater,
Serge E. Hallyn, Michael Opdenacker, linux-embedded
Le Fri, 01 Aug 2008 12:08:09 -0700,
Matt Helsley <matthltc@us.ibm.com> a écrit :
> How about making it depend on a combination of CONFIG
> variables? Here's an RFC PATCH. Completely untested.
It solves my kernel size increase problem, so it's perfectly fine for
me.
Thanks!
Thomas
--
Thomas Petazzoni, Free Electrons
Kernel, drivers and embedded Linux development,
consulting, training and support.
http://free-electrons.com
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 2/6] Container Freezer: Make refrigerator always available
2008-08-01 23:24 ` Matt Helsley
@ 2008-08-02 14:34 ` Rafael J. Wysocki
0 siblings, 0 replies; 27+ messages in thread
From: Rafael J. Wysocki @ 2008-08-02 14:34 UTC (permalink / raw)
To: Matt Helsley
Cc: Andrew Morton, Thomas Petazzoni, Paul Menage, Li Zefan,
Linux-Kernel, Linux Containers, linux-pm, Cedric Le Goater,
Serge E. Hallyn, Michael Opdenacker, linux-embedded
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="utf-7", Size: 7917 bytes --]
On Saturday, 2 of August 2008, Matt Helsley wrote:> > On Sat, 2008-08-02 at 00:53 +-0200, Rafael J. Wysocki wrote:> > On Friday, 1 of August 2008, Matt Helsley wrote:> > > > > > On Fri, 2008-08-01 at 16:27 +-0200, Thomas Petazzoni wrote:> > > > Hi,> > > > > > > > Le Thu, 31 Jul 2008 22:07:01 -0700,> > > > Matt Helsley <matthltc@us.ibm.com> a +AOk-crit :> > > > > > > > > --- a/kernel/Makefile> > > > > +-+-+- b/kernel/Makefile> > > > > @@ -5,7 +-5,7 @@> > > > > obj-y = sched.o fork.o exec_domain.o panic.o printk.o +AFw> > > > > cpu.o exit.o itimer.o time.o softirq.o resource.o +AFw> > > > > sysctl.o capability.o ptrace.o timer.o user.o +AFw> > > > > - signal.o sys.o kmod.o workqueue.o pid.o +AFw> > > > > +- signal.o sys.o kmod.o workqueue.o pid.o freezer.o +AFw> > > > > > > > I have the impression that the code in kernel/power/process.c was> > > > compiled only if CONFIG_PM_SLEEP was set. Now that the code has been> > > > moved to kernel/freezer.c, it is unconditionnaly compiled in every> > > > kernel. Is that correct ?> > > >> > > > If so, is it possible to put this new feature under some> > > > CONFIG_SOMETHING option, for people who care about the kernel size ?> > > > > > How about making it depend on a combination of CONFIG variables?> > > Here's an RFC PATCH. Completely untested.> > > > > > Signed-off-by: Matt Helsley <matthltc@us.ibm.com>> > > > Can you please also make the contents of include/linux/freezer.h depend on> > CONFIG_FREEZER instead of CONFIG_PM_SLEEP?> > Good point -- I'll add that to this patch and repost.> > > Also, I'm not really sure if kernel/power/Kconfig is the right place to define> > CONFIG_FREEZER.> > There's no nice place to put it since we're dealing with CONFIG_> variables in two different Kconfig files. I put it in> kernel/power/Kconfig because I wasn't certain Kbuild would do the right> thing if I referenced PM_SLEEP from init/Kconfig.> > > Perhaps we should even move freezer.c from kernel/power to kernel> > It's already there.
Yes, sorry.
> Perhaps you meant something else (kernel/power/process.c?)?
Well, I'll have to actually apply the patches and look at the modified code.
> > and define CONFIG_FREEZER in Kconfig in there. Andrew, what do you think?> > The Kconfig files in kernel/ are Kconfig.hz and Kconfig.preemt which> don't seem appropriate. I suppose we could add another (perhaps> Kconfig.cgroup).
Either that, or Kconfig.freezer maybe? After all, it will also be used forPM_SLEEP, at least for some time.
> Thanks for the review!
You're welcome.
Thanks,Rafael\07mNó\x7f\0\0ùn\0\0\0\0\0Ð7mNó\x7f\0\0p4o\0\0\0\0\0\0\0\0\0\0\0\0\00¾g\0\0\0\0\0A\x15\0\0\0\0\0\0pà\x01\0\0\0\0À©Mó\x7f\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0Ð7mNó\x7f\0\0 5o\0\0\0\0\0\0\0\0\0\0\0\0\0Ð7mNó\x7f\0\0ùn\0\0\0\0\0Ð7mNó\x7f\0\0`5o\0\0\0\0\0\0\0\0\0\0\0\0\05o\0\0\0\0\0Ñ\x14\0\0\0\0\0\0pà\x01\0\0\0\0À©Mó\x7f\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0Ð7mNó\x7f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ÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
^ permalink raw reply [flat|nested] 27+ messages in thread
* Re: [PATCH 3/6] Container Freezer: Implement freezer cgroup subsystem
2008-08-02 7:38 ` Cedric Le Goater
@ 2008-08-02 14:37 ` Rafael J. Wysocki
0 siblings, 0 replies; 27+ messages in thread
From: Rafael J. Wysocki @ 2008-08-02 14:37 UTC (permalink / raw)
To: Cedric Le Goater
Cc: Matt Helsley, Andrew Morton, Paul Menage, Li Zefan, Linux-Kernel,
Linux Containers, linux-pm, Serge E. Hallyn
On Saturday, 2 of August 2008, Cedric Le Goater wrote:
> Matt Helsley wrote:
> > On Sat, 2008-08-02 at 00:58 +0200, Rafael J. Wysocki wrote:
> >> On Friday, 1 of August 2008, Matt Helsley wrote:
> >>> 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.
> >>>
> >>> 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>
> >>> ---
> >>> include/linux/cgroup_freezer.h | 71 ++++++++
> >>> include/linux/cgroup_subsys.h | 6
> >>> include/linux/freezer.h | 16 +-
> >>> init/Kconfig | 7
> >>> kernel/Makefile | 1
> >>> kernel/cgroup_freezer.c | 328 +++++++++++++++++++++++++++++++++++++++++
> >>> 6 files changed, 425 insertions(+), 4 deletions(-)
> >>> create mode 100644 include/linux/cgroup_freezer.h
> >>> create mode 100644 kernel/cgroup_freezer.c
> >>>
> >>> Index: linux-2.6.27-rc1-mm1/include/linux/cgroup_freezer.h
> >>> ===================================================================
> >>> --- /dev/null
> >>> +++ linux-2.6.27-rc1-mm1/include/linux/cgroup_freezer.h
> >>> @@ -0,0 +1,71 @@
> >>> +#ifndef _LINUX_CGROUP_FREEZER_H
> >>> +#define _LINUX_CGROUP_FREEZER_H
> >>> +/*
> >>> + * cgroup_freezer.h - control group freezer subsystem interface
> >>> + *
> >>> + * Copyright IBM Corporation, 2007
> >>> + *
> >>> + * Author : Cedric Le Goater <clg@fr.ibm.com>
> >>> + *
> >>> + * This program is free software; you can redistribute it and/or modify it
> >>> + * under the terms of version 2.1 of the GNU Lesser General Public License
> >>> + * as published by the Free Software Foundation.
> >>> + *
> >>> + * This program is distributed in the hope that it would be useful, but
> >>> + * WITHOUT ANY WARRANTY; without even the implied warranty of
> >>> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
> >>> + */
> >>> +
> >>> +#include <linux/cgroup.h>
> >>> +
> >>> +#ifdef CONFIG_CGROUP_FREEZER
> >>> +
> >>> +enum freezer_state {
> >>> + STATE_RUNNING = 0,
> >>> + STATE_FREEZING,
> >>> + STATE_FROZEN,
> >>> +};
> >>> +
> >>> +struct freezer {
> >>> + struct cgroup_subsys_state css;
> >>> + enum freezer_state state;
> >>> + spinlock_t lock; /* protects _writes_ to state */
> >>> +};
> >>> +
> >>> +static inline struct freezer *cgroup_freezer(
> >>> + struct cgroup *cgroup)
> >>> +{
> >>> + return container_of(
> >>> + cgroup_subsys_state(cgroup, freezer_subsys_id),
> >>> + struct freezer, css);
> >>> +}
> >>> +
> >>> +static inline struct freezer *task_freezer(struct task_struct *task)
> >>> +{
> >>> + return container_of(task_subsys_state(task, freezer_subsys_id),
> >>> + struct freezer, css);
> >>> +}
> >>> +
> >>> +static inline int cgroup_frozen(struct task_struct *task)
> >>> +{
> >>> + struct freezer *freezer;
> >>> + enum freezer_state state;
> >>> +
> >>> + task_lock(task);
> >>> + freezer = task_freezer(task);
> >>> + state = freezer->state;
> >>> + task_unlock(task);
> >>> +
> >>> + return state == STATE_FROZEN;
> >>> +}
> >>> +
> >>> +#else /* !CONFIG_CGROUP_FREEZER */
> >>> +
> >>> +static inline int cgroup_frozen(struct task_struct *task)
> >>> +{
> >>> + return 0;
> >>> +}
> >>> +
> >>> +#endif /* !CONFIG_CGROUP_FREEZER */
> >>> +
> >>> +#endif /* _LINUX_CGROUP_FREEZER_H */
> >> Hmm. I wonder if we really need a separate file for this. I'd prefer it to be
> >> in freezer.h, unless there's a good reason not to place it in there.
> >
> > Yeah, it's a pretty small header so combining it with another header
> > would be nice. However if we combine it with freezer.h we'd be including
> > cgroup.h in unrelated filesystem code. An alternative might be to put it
> > into a cgroup header for "small" subsystems (which might just be
> > cgroup.h for now..).
> >
> > Thanks for the review!
>
> I'm not sure the inline is really useful. In that case, we could probably do
> something like the following :
>
> include/linux/freezer.h :
>
> #ifdef CONFIG_CGROUP_FREEZER
>
> extern int cgroup_frozen(struct task_struct *task);
>
> #else /* !CONFIG_CGROUP_FREEZER */
>
> static inline int cgroup_frozen(struct task_struct *task)
> {
> return 0;
> }
>
> #endif /* !CONFIG_CGROUP_FREEZER */
>
> and in kernel/cgroup_freezer.c:
>
> int cgroup_frozen(struct task_struct *task)
> {
> struct freezer *freezer;
> enum freezer_state state;
>
> task_lock(task);
> freezer = task_freezer(task);
> state = freezer->state;
> task_unlock(task);
>
> return state == STATE_FROZEN;
> }
>
> and kill include/linux/cgroup_freezer.h ?
I'd prefer this.
Thanks,
Rafael
^ permalink raw reply [flat|nested] 27+ messages in thread
end of thread, other threads:[~2008-08-04 22:11 UTC | newest]
Thread overview: 27+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-01 5:06 [PATCH 0/6] Container Freezer: Reuse Suspend Freezer Matt Helsley
2008-08-01 5:07 ` [PATCH 1/6] Container Freezer: Add TIF_FREEZE flag to all architectures Matt Helsley
2008-08-01 10:32 ` Nigel Cunningham
2008-08-01 12:32 ` Cedric Le Goater
2008-08-01 22:05 ` Matt Helsley
2008-08-01 22:54 ` Rafael J. Wysocki
2008-08-02 1:13 ` Nigel Cunningham
2008-08-01 5:07 ` [PATCH 2/6] Container Freezer: Make refrigerator always available Matt Helsley
2008-08-01 10:33 ` Nigel Cunningham
2008-08-01 14:27 ` Thomas Petazzoni
2008-08-01 19:08 ` Matt Helsley
2008-08-01 22:53 ` Rafael J. Wysocki
2008-08-01 23:24 ` Matt Helsley
2008-08-02 14:34 ` Rafael J. Wysocki
2008-08-02 2:30 ` Matt Helsley
2008-08-02 10:39 ` Thomas Petazzoni
2008-08-01 5:07 ` [PATCH 3/6] Container Freezer: Implement freezer cgroup subsystem Matt Helsley
2008-08-01 22:58 ` Rafael J. Wysocki
2008-08-02 0:11 ` Matt Helsley
2008-08-02 7:38 ` Cedric Le Goater
2008-08-02 14:37 ` Rafael J. Wysocki
2008-08-01 5:07 ` [PATCH 4/6] Container Freezer: Skip frozen cgroups during power management resume Matt Helsley
2008-08-01 10:24 ` Nigel Cunningham
2008-08-01 5:07 ` [PATCH 5/6] Container Freezer: Prevent frozen tasks or cgroups from changing Matt Helsley
2008-08-01 5:07 ` [PATCH 6/6] Container Freezer: Use cgroup write_string method Matt Helsley
2008-08-01 5:16 ` [PATCH 0/6] Container Freezer: Reuse Suspend Freezer Matt Helsley
2008-08-01 13:04 ` Rafael J. Wysocki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox