diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-06 20:38:49 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-06 20:38:49 -0500 |
commit | 8ba7b0a14b2ec19583bedbcdbea7f1c5008fc922 (patch) | |
tree | 5047966d39ce26f7afd96b794dd4dc6a995458a5 | |
parent | 91c0bce29e4050a59ee5fdc1192b60bbf8693a6d (diff) |
Add early-boot-safety check to cond_resched()
Just to be safe, we should not trigger a conditional reschedule during
the early boot sequence. We've historically done some questionable
early on, and the safety warnings in __might_sleep() are generally
turned off during that period, so there might be problems lurking.
This affects CONFIG_PREEMPT_VOLUNTARY, which takes over might_sleep() to
cause a voluntary conditional reschedule.
Acked-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | kernel/sched.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/sched.c b/kernel/sched.c index 12d291bf3379..3454bb869fd0 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -4028,6 +4028,8 @@ static inline void __cond_resched(void) | |||
4028 | */ | 4028 | */ |
4029 | if (unlikely(preempt_count())) | 4029 | if (unlikely(preempt_count())) |
4030 | return; | 4030 | return; |
4031 | if (unlikely(system_state != SYSTEM_RUNNING)) | ||
4032 | return; | ||
4031 | do { | 4033 | do { |
4032 | add_preempt_count(PREEMPT_ACTIVE); | 4034 | add_preempt_count(PREEMPT_ACTIVE); |
4033 | schedule(); | 4035 | schedule(); |