kernel-ark/kernel
Andrew Morton e7b384043e [PATCH] cond_resched() fix
Fix a bug identified by Zou Nan hai <nanhai.zou@intel.com>:

If the system is in state SYSTEM_BOOTING, and need_resched() is true,
cond_resched() returns true even though it didn't reschedule.  Consequently
need_resched() remains true and JBD locks up.

Fix that by teaching cond_resched() to only return true if it really did call
schedule().

cond_resched_lock() and cond_resched_softirq() have a problem too.  If we're
in SYSTEM_BOOTING state and need_resched() is true, these functions will drop
the lock and will then try to call schedule(), but the SYSTEM_BOOTING state
will prevent schedule() from being called.  So on return, need_resched() will
still be true, but cond_resched_lock() has to return 1 to tell the caller that
the lock was dropped.  The caller will probably lock up.

Bottom line: if these functions dropped the lock, they _must_ call schedule()
to clear need_resched().   Make it so.

Also, uninline __cond_resched().  It's largeish, and slowpath.

Acked-by: Ingo Molnar <mingo@elte.hu>
Cc: <stable@kernel.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-06-30 11:25:38 -07:00
..
irq [PATCH] genirq: add chip->eoi(), fastack -> fasteoi 2006-06-29 10:26:26 -07:00
power [PATCH] pm_trace is dangerous 2006-06-27 17:32:35 -07:00
time
.gitignore
acct.c [PATCH] fix kernel-doc in kernel/ dir 2006-06-27 17:32:39 -07:00
audit.c [NETLINK]: Encapsulate eff_cap usage within security framework. 2006-06-29 16:57:55 -07:00
audit.h
auditfilter.c
auditsc.c [PATCH] Remove redundant NULL checks before [kv]free - in kernel/ 2006-06-27 17:32:48 -07:00
capability.c
compat.c
configs.c
cpu.c [PATCH] cpu hotplug: make [un]register_cpu_notifier init time only 2006-06-27 17:32:41 -07:00
cpuset.c
dma.c
exec_domain.c
exit.c [PATCH] pi-futex: futex_lock_pi/futex_unlock_pi support 2006-06-27 17:32:47 -07:00
extable.c
fork.c [PATCH] pi-futex: futex_lock_pi/futex_unlock_pi support 2006-06-27 17:32:47 -07:00
futex_compat.c [PATCH] pi-futex: futex_lock_pi/futex_unlock_pi support 2006-06-27 17:32:47 -07:00
futex.c [PATCH] futex_requeue() optimization 2006-06-27 17:32:48 -07:00
hrtimer.c [PATCH] cpu hotplug: revert initdata patch submitted for 2.6.17 2006-06-27 17:32:41 -07:00
itimer.c
kallsyms.c
Kconfig.hz
Kconfig.preempt
kexec.c [POWERPC] Add the use of the firmware soft-reset-nmi to kdump. 2006-06-28 15:18:52 +10:00
kfifo.c
kmod.c
kprobes.c
ksysfs.c
kthread.c
Makefile [PATCH] pi-futex: rt mutex tester 2006-06-27 17:32:47 -07:00
module.c [PATCH] load_module() cleanup 2006-06-28 14:59:04 -07:00
mutex-debug.c [PATCH] poison: add & use more constants 2006-06-27 17:32:38 -07:00
mutex-debug.h
mutex.c
mutex.h
panic.c
params.c
pid.c
posix-cpu-timers.c
posix-timers.c
printk.c
profile.c [PATCH] cpu hotplug: revert init patch submitted for 2.6.17 2006-06-27 17:32:40 -07:00
ptrace.c
rcupdate.c [PATCH] cpu hotplug: revert initdata patch submitted for 2.6.17 2006-06-27 17:32:41 -07:00
rcutorture.c [PATCH] rcutorture: add call_rcu_bh() operations 2006-06-27 17:32:40 -07:00
relay.c
resource.c Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/pci-2.6 2006-06-29 10:49:17 -07:00
rtmutex_common.h [PATCH] pi-futex: futex_lock_pi/futex_unlock_pi support 2006-06-27 17:32:47 -07:00
rtmutex-debug.c [PATCH] pi-futex: rt mutex debug 2006-06-27 17:32:47 -07:00
rtmutex-debug.h [PATCH] pi-futex: rt mutex debug 2006-06-27 17:32:47 -07:00
rtmutex-tester.c [PATCH] rtmutex: Modify rtmutex-tester to test the setscheduler propagation 2006-06-27 17:32:47 -07:00
rtmutex.c [PATCH] rtmutex: Propagate priority settings into PI lock chains 2006-06-27 17:32:48 -07:00
rtmutex.h [PATCH] pi-futex: rt mutex core 2006-06-27 17:32:47 -07:00
sched.c [PATCH] cond_resched() fix 2006-06-30 11:25:38 -07:00
seccomp.c
signal.c [PATCH] SELinux: add security hook call to kill_proc_info_as_uid 2006-06-30 11:25:37 -07:00
softirq.c [PATCH] cpu hotplug: revert initdata patch submitted for 2.6.17 2006-06-27 17:32:41 -07:00
softlockup.c [PATCH] cpu hotplug: revert initdata patch submitted for 2.6.17 2006-06-27 17:32:41 -07:00
spinlock.c
stop_machine.c
sys_ni.c
sys.c
sysctl.c [PATCH] zoned vm counters: zone_reclaim: remove /proc/sys/vm/zone_reclaim_interval 2006-06-30 11:25:35 -07:00
time.c
timer.c [PATCH] cpu hotplug: revert initdata patch submitted for 2.6.17 2006-06-27 17:32:41 -07:00
uid16.c
unwind.c
user.c
wait.c
workqueue.c [PATCH] cpu hotplug: revert init patch submitted for 2.6.17 2006-06-27 17:32:40 -07:00