Tejun Heo
a3201227f8
freezer: make freezing() test freeze conditions in effect instead of TIF_FREEZE
...
Using TIF_FREEZE for freezing worked when there was only single
freezing condition (the PM one); however, now there is also the
cgroup_freezer and single bit flag is getting clumsy.
thaw_processes() is already testing whether cgroup freezing in in
effect to avoid thawing tasks which were frozen by both PM and cgroup
freezers.
This is racy (nothing prevents race against cgroup freezing) and
fragile. A much simpler way is to test actual freeze conditions from
freezing() - ie. directly test whether PM or cgroup freezing is in
effect.
This patch adds variables to indicate whether and what type of
freezing conditions are in effect and reimplements freezing() such
that it directly tests whether any of the two freezing conditions is
active and the task should freeze. On fast path, freezing() is still
very cheap - it only tests system_freezing_cnt.
This makes the clumsy dancing aroung TIF_FREEZE unnecessary and
freeze/thaw operations more usual - updating state variables for the
new state and nudging target tasks so that they notice the new state
and comply. As long as the nudging happens after state update, it's
race-free.
* This allows use of freezing() in freeze_task(). Replace the open
coded tests with freezing().
* p != current test is added to warning printing conditions in
try_to_freeze_tasks() failure path. This is necessary as freezing()
is now true for the task which initiated freezing too.
-v2: Oleg pointed out that re-freezing FROZEN cgroup could increment
system_freezing_cnt. Fixed.
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Paul Menage <paul@paulmenage.org> (for the cgroup portions)
2011-11-21 12:32:25 -08:00
..
debug
Merge branch 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux
2011-11-06 19:44:47 -08:00
events
Merge branch 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux
2011-11-06 19:44:47 -08:00
gcov
irq
Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
2011-11-17 11:46:26 -02:00
power
freezer: make freezing() test freeze conditions in effect instead of TIF_FREEZE
2011-11-21 12:32:25 -08:00
time
kernel: Fix files explicitly needing EXPORT_SYMBOL infrastructure
2011-10-31 19:30:05 -04:00
trace
kernel: Fix files explicitly needing EXPORT_SYMBOL infrastructure
2011-10-31 19:30:05 -04:00
.gitignore
acct.c
async.c
kernel: Map most files to use export.h instead of module.h
2011-10-31 09:20:12 -04:00
audit.c
kernel: Map most files to use export.h instead of module.h
2011-10-31 09:20:12 -04:00
audit.h
audit_tree.c
audit_watch.c
auditfilter.c
auditsc.c
kernel: Map most files to use export.h instead of module.h
2011-10-31 09:20:12 -04:00
backtracetest.c
bounds.c
capability.c
kernel: Map most files to use export.h instead of module.h
2011-10-31 09:20:12 -04:00
cgroup.c
memcg: replace ss->id_lock with a rwlock
2011-11-02 16:07:03 -07:00
cgroup_freezer.c
freezer: make freezing() test freeze conditions in effect instead of TIF_FREEZE
2011-11-21 12:32:25 -08:00
compat.c
kernel: Fix files explicitly needing EXPORT_SYMBOL infrastructure
2011-10-31 19:30:05 -04:00
configs.c
cpu.c
Merge branch 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux
2011-11-06 19:44:47 -08:00
cpu_pm.c
cpu_pm: call notifiers during suspend
2011-09-23 12:05:29 +05:30
cpuset.c
Merge branch 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux
2011-11-06 19:44:47 -08:00
crash_dump.c
Merge branch 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux
2011-11-06 19:44:47 -08:00
cred.c
kernel: Map most files to use export.h instead of module.h
2011-10-31 09:20:12 -04:00
delayacct.c
dma.c
kernel: Map most files to use export.h instead of module.h
2011-10-31 09:20:12 -04:00
elfcore.c
exec_domain.c
exit.c
freezer: remove racy clear_freeze_flag() and set PF_NOFREEZE on dead tasks
2011-11-21 12:32:23 -08:00
extable.c
fork.c
freezer: make freezing() test freeze conditions in effect instead of TIF_FREEZE
2011-11-21 12:32:25 -08:00
freezer.c
freezer: make freezing() test freeze conditions in effect instead of TIF_FREEZE
2011-11-21 12:32:25 -08:00
futex.c
kernel: Map most files to use export.h instead of module.h
2011-10-31 09:20:12 -04:00
futex_compat.c
groups.c
kernel: Map most files to use export.h instead of module.h
2011-10-31 09:20:12 -04:00
hrtimer.c
kernel: Map most files to use export.h instead of module.h
2011-10-31 09:20:12 -04:00
hung_task.c
kernel: Map most files to use export.h instead of module.h
2011-10-31 09:20:12 -04:00
irq_work.c
kernel: fix two implicit header assumptions in irq_work.c
2011-10-31 09:20:12 -04:00
itimer.c
jump_label.c
jump-label: initialize jump-label subsystem much earlier
2011-10-25 11:55:15 -07:00
kallsyms.c
Kconfig.freezer
Kconfig.hz
Kconfig.locks
Kconfig.preempt
kexec.c
[S390] kdump: Add infrastructure for unmapping crashkernel memory
2011-10-30 15:16:42 +01:00
kfifo.c
kernel: Map most files to use export.h instead of module.h
2011-10-31 09:20:12 -04:00
kmod.c
kmod: prevent kmod_loop_msg overflow in __request_module()
2011-10-26 13:10:39 +10:30
kprobes.c
kernel: Map most files to use export.h instead of module.h
2011-10-31 09:20:12 -04:00
ksysfs.c
kernel: ksysfs.c is implicitly using stat.h
2011-10-31 09:20:13 -04:00
kthread.c
freezer: implement and use kthread_freezable_should_stop()
2011-11-21 12:32:23 -08:00
latencytop.c
kernel: Map most files to use export.h instead of module.h
2011-10-31 09:20:12 -04:00
lockdep.c
Merge branch 'core-rcu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
2011-10-26 16:26:53 +02:00
lockdep_internals.h
lockdep_proc.c
kernel: Map most files to use export.h instead of module.h
2011-10-31 09:20:12 -04:00
lockdep_states.h
Makefile
Merge branch 'devel-stable' of http://ftp.arm.linux.org.uk/pub/linux/arm/kernel/git-cur/linux-2.6-arm
2011-10-28 12:02:27 -07:00
module.c
Merge branch 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux
2011-11-06 19:44:47 -08:00
mutex-debug.c
kernel: Map most files to use export.h instead of module.h
2011-10-31 09:20:12 -04:00
mutex-debug.h
mutex.c
kernel: Map most files to use export.h instead of module.h
2011-10-31 09:20:12 -04:00
mutex.h
notifier.c
kernel: Map most files to use export.h instead of module.h
2011-10-31 09:20:12 -04:00
nsproxy.c
kernel: Map most files to use export.h instead of module.h
2011-10-31 09:20:12 -04:00
padata.c
kernel: Map most files to use export.h instead of module.h
2011-10-31 09:20:12 -04:00
panic.c
module,bug: Add TAINT_OOT_MODULE flag for modules not built in-tree
2011-11-07 07:54:42 +10:30
params.c
kernel: params.c needs module.h not moduleparam.h
2011-10-31 09:20:13 -04:00
pid.c
kernel: Map most files to use export.h instead of module.h
2011-10-31 09:20:12 -04:00
pid_namespace.c
posix-cpu-timers.c
Merge branch 'core-locking-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
2011-10-26 16:17:32 +02:00
posix-timers.c
kernel: Map most files to use export.h instead of module.h
2011-10-31 09:20:12 -04:00
printk.c
printk: remove bounds checking for log_prefix
2011-10-31 17:30:53 -07:00
profile.c
kernel: Map most files to use export.h instead of module.h
2011-10-31 09:20:12 -04:00
ptrace.c
kernel: Map most files to use export.h instead of module.h
2011-10-31 09:20:12 -04:00
range.c
range: fix bogus misuse of module.h to get printk()
2011-10-31 09:20:11 -04:00
rcu.h
rcu: Add grace-period, quiescent-state, and call_rcu trace events
2011-09-28 21:38:21 -07:00
rcupdate.c
kernel: Map most files to use export.h instead of module.h
2011-10-31 09:20:12 -04:00
rcutiny.c
kernel: fix up module header handling in rcutiny files
2011-10-31 09:20:13 -04:00
rcutiny_plugin.h
kernel: fix up module header handling in rcutiny files
2011-10-31 09:20:13 -04:00
rcutorture.c
rcu: Make rcu_torture_boost() exit loops at end of test
2011-09-28 21:38:46 -07:00
rcutree.c
kernel: Map most files to use export.h instead of module.h
2011-10-31 09:20:12 -04:00
rcutree.h
rcu: Remove rcu_needs_cpu_flush() to avoid false quiescent states
2011-09-28 21:38:48 -07:00
rcutree_plugin.h
rcu: Remove rcu_needs_cpu_flush() to avoid false quiescent states
2011-09-28 21:38:48 -07:00
rcutree_trace.c
rcu: Simplify quiescent-state accounting
2011-09-28 21:38:22 -07:00
relay.c
kernel: Map most files to use export.h instead of module.h
2011-10-31 09:20:12 -04:00
res_counter.c
resource.c
kernel: Map most files to use export.h instead of module.h
2011-10-31 09:20:12 -04:00
rtmutex-debug.c
kernel: Map most files to use export.h instead of module.h
2011-10-31 09:20:12 -04:00
rtmutex-debug.h
rtmutex-tester.c
kernel: Map most files to use export.h instead of module.h
2011-10-31 09:20:12 -04:00
rtmutex.c
kernel: Map most files to use export.h instead of module.h
2011-10-31 09:20:12 -04:00
rtmutex.h
rtmutex_common.h
rwsem.c
kernel: Map most files to use export.h instead of module.h
2011-10-31 09:20:12 -04:00
sched.c
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc
2011-11-06 17:12:03 -08:00
sched_autogroup.c
sched_autogroup.h
sched_clock.c
kernel: Map most files to use export.h instead of module.h
2011-10-31 09:20:12 -04:00
sched_cpupri.c
sched_cpupri.h
sched_debug.c
sched_fair.c
sched: Wrap scheduler p->cpus_allowed access
2011-10-06 12:46:56 +02:00
sched_features.h
sched_idletask.c
sched_rt.c
sched: Warn on rt throttling
2011-10-06 12:47:04 +02:00
sched_stats.h
sched_stoptask.c
seccomp.c
semaphore.c
kernel: Map most files to use export.h instead of module.h
2011-10-31 09:20:12 -04:00
signal.c
kernel: Map most files to use export.h instead of module.h
2011-10-31 09:20:12 -04:00
smp.c
kernel: Map most files to use export.h instead of module.h
2011-10-31 09:20:12 -04:00
softirq.c
kernel: Map most files to use export.h instead of module.h
2011-10-31 09:20:12 -04:00
spinlock.c
kernel: Map most files to use export.h instead of module.h
2011-10-31 09:20:12 -04:00
srcu.c
kernel: Map most files to use export.h instead of module.h
2011-10-31 09:20:12 -04:00
stacktrace.c
kernel: Map most files to use export.h instead of module.h
2011-10-31 09:20:12 -04:00
stop_machine.c
Merge branch 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux
2011-11-06 19:44:47 -08:00
sys.c
Merge branch 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux
2011-11-06 19:44:47 -08:00
sys_ni.c
Cross Memory Attach
2011-10-31 17:30:44 -07:00
sysctl.c
Merge branch 'akpm' (Andrew's incoming)
2011-10-31 17:46:07 -07:00
sysctl_binary.c
ipv4: NET_IPV4_ROUTE_GC_INTERVAL removal
2011-10-03 14:13:01 -04:00
sysctl_check.c
taskstats.c
test_kprobes.c
time.c
kernel: Map most files to use export.h instead of module.h
2011-10-31 09:20:12 -04:00
timeconst.pl
timer.c
kernel: Map most files to use export.h instead of module.h
2011-10-31 09:20:12 -04:00
tracepoint.c
tsacct.c
uid16.c
up.c
kernel: Map most files to use export.h instead of module.h
2011-10-31 09:20:12 -04:00
user-return-notifier.c
kernel: Map most files to use export.h instead of module.h
2011-10-31 09:20:12 -04:00
user.c
kernel: Map most files to use export.h instead of module.h
2011-10-31 09:20:12 -04:00
user_namespace.c
kernel: Map most files to use export.h instead of module.h
2011-10-31 09:20:12 -04:00
utsname.c
kernel: Map most files to use export.h instead of module.h
2011-10-31 09:20:12 -04:00
utsname_sysctl.c
Merge branch 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux
2011-11-06 19:44:47 -08:00
wait.c
kernel: Map most files to use export.h instead of module.h
2011-10-31 09:20:12 -04:00
watchdog.c
watchdog: move watchdog_*_all_cpus under CONFIG_SYSCTL
2011-10-31 17:30:53 -07:00
workqueue.c
kernel: Map most files to use export.h instead of module.h
2011-10-31 09:20:12 -04:00
workqueue_sched.h