Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 115881
b: refs/heads/master
c: dc52ddc
h: refs/heads/master
i:
  115879: c488565
v: v3
  • Loading branch information
Matt Helsley authored and Linus Torvalds committed Oct 20, 2008
1 parent fcc499a commit daee211
Show file tree
Hide file tree
Showing 31 changed files with 466 additions and 23 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8174f1503f4bf7e9a14b3fbbfdb30c6be6e29f77
refs/heads/master: dc52ddc0e6f45b04780b26fc0813509f8e798c42
1 change: 1 addition & 0 deletions trunk/arch/alpha/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ config AUTO_IRQ_AFFINITY
default y

source "init/Kconfig"
source "kernel/Kconfig.freezer"


menu "System setup"
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ config VECTORS_BASE

source "init/Kconfig"

source "kernel/Kconfig.freezer"

menu "System Type"

choice
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/avr32/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ config GENERIC_BUG

source "init/Kconfig"

source "kernel/Kconfig.freezer"

menu "System Type and features"

source "kernel/time/Kconfig"
Expand Down
3 changes: 3 additions & 0 deletions trunk/arch/blackfin/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,11 @@ config HARDWARE_PM
depends on OPROFILE

source "init/Kconfig"

source "kernel/Kconfig.preempt"

source "kernel/Kconfig.freezer"

menu "Blackfin Processor Options"

comment "Processor and Board Settings"
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/cris/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ config HZ

source "init/Kconfig"

source "kernel/Kconfig.freezer"

menu "General setup"

source "fs/Kconfig.binfmt"
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/frv/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ mainmenu "Fujitsu FR-V Kernel Configuration"

source "init/Kconfig"

source "kernel/Kconfig.freezer"


menu "Fujitsu FR-V system setup"

Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/h8300/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ config HZ

source "init/Kconfig"

source "kernel/Kconfig.freezer"

source "arch/h8300/Kconfig.cpu"

menu "Executable file formats"
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/ia64/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ mainmenu "IA-64 Linux Kernel Configuration"

source "init/Kconfig"

source "kernel/Kconfig.freezer"

menu "Processor type and features"

config IA64
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/m32r/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ config HZ

source "init/Kconfig"

source "kernel/Kconfig.freezer"


menu "Processor type and features"

Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/m68k/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ mainmenu "Linux/68k Kernel Configuration"

source "init/Kconfig"

source "kernel/Kconfig.freezer"

menu "Platform dependent setup"

config EISA
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/m68knommu/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ config NO_IOPORT

source "init/Kconfig"

source "kernel/Kconfig.freezer"

menu "Processor type and features"

choice
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/mips/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1885,6 +1885,8 @@ config PROBE_INITRD_HEADER
add initrd or initramfs image to the kernel image.
Otherwise, say N.

source "kernel/Kconfig.freezer"

menu "Bus options (PCI, PCMCIA, EISA, ISA, TC)"

config HW_HAS_EISA
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/mn10300/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,8 @@ mainmenu "Matsushita MN10300/AM33 Kernel Configuration"

source "init/Kconfig"

source "kernel/Kconfig.freezer"


menu "Matsushita MN10300 system setup"

Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/parisc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ config ARCH_MAY_HAVE_PC_FDC

source "init/Kconfig"

source "kernel/Kconfig.freezer"


menu "Processor type and features"

Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/powerpc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,8 @@ config PPC_OF_PLATFORM_PCI

source "init/Kconfig"

source "kernel/Kconfig.freezer"

source "arch/powerpc/sysdev/Kconfig"
source "arch/powerpc/platforms/Kconfig"

Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/s390/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ config S390

source "init/Kconfig"

source "kernel/Kconfig.freezer"

menu "Base setup"

comment "Processor type and features"
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/sh/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ config IO_TRAPPED

source "init/Kconfig"

source "kernel/Kconfig.freezer"

menu "System type"

#
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/sparc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ config HZ

source "init/Kconfig"

source "kernel/Kconfig.freezer"

menu "General machine setup"

config SMP
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/sparc64/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ config GENERIC_HARDIRQS_NO__DO_IRQ
def_bool y

source "init/Kconfig"
source "kernel/Kconfig.freezer"

menu "Processor type and features"

Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/um/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,8 @@ endmenu

source "init/Kconfig"

source "kernel/Kconfig.freezer"

source "drivers/block/Kconfig"

source "arch/um/Kconfig.char"
Expand Down
1 change: 1 addition & 0 deletions trunk/arch/x86/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ config X86_TRAMPOLINE
config KTIME_SCALAR
def_bool X86_32
source "init/Kconfig"
source "kernel/Kconfig.freezer"

menu "Processor type and features"

Expand Down
1 change: 1 addition & 0 deletions trunk/arch/xtensa/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ config HZ
default 100

source "init/Kconfig"
source "kernel/Kconfig.freezer"

menu "Processor type and features"

Expand Down
6 changes: 6 additions & 0 deletions trunk/include/linux/cgroup_subsys.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,9 @@ SUBSYS(devices)
#endif

/* */

#ifdef CONFIG_CGROUP_FREEZER
SUBSYS(freezer)
#endif

/* */
29 changes: 10 additions & 19 deletions trunk/include/linux/freezer.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,26 +46,11 @@ static inline bool should_send_signal(struct task_struct *p)

/*
* Wake up a frozen process
*
* task_lock() is taken 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)
{
task_lock(p);
if (frozen(p)) {
p->flags &= ~PF_FROZEN;
task_unlock(p);
wake_up_process(p);
return 1;
}
clear_freeze_flag(p);
task_unlock(p);
return 0;
}
extern int __thaw_process(struct task_struct *p);

/* Takes and releases task alloc lock using task_lock() */
extern int thaw_process(struct task_struct *p);

extern void refrigerator(void);
extern int freeze_processes(void);
Expand All @@ -83,6 +68,12 @@ static inline int try_to_freeze(void)
extern bool freeze_task(struct task_struct *p, bool sig_only);
extern void cancel_freezing(struct task_struct *p);

#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 */

/*
* 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
Expand Down
7 changes: 7 additions & 0 deletions trunk/init/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,13 @@ config CGROUP_NS
for instance virtual servers and checkpoint/restart
jobs.

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 CGROUP_DEVICE
bool "Device controller for cgroups"
depends on CGROUPS && EXPERIMENTAL
Expand Down
2 changes: 2 additions & 0 deletions trunk/kernel/Kconfig.freezer
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
config FREEZER
def_bool PM_SLEEP || CGROUP_FREEZER
1 change: 1 addition & 0 deletions trunk/kernel/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ obj-$(CONFIG_BACKTRACE_SELF_TEST) += backtracetest.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
Expand Down
Loading

0 comments on commit daee211

Please sign in to comment.