diff options
author | Ingo Molnar <mingo@elte.hu> | 2011-04-14 08:50:37 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2011-04-14 08:51:07 +0200 |
commit | a4c98f8bbeafee12c979c90743f6fda94f7515c7 (patch) | |
tree | 3dda24b8a2ec42ab7b42845cb68c8b6e1b0d501f /kernel | |
parent | f4ad9bd208c98f32a6f9136618e0b8bebe3fb370 (diff) | |
parent | 85f2e689a5c8fb6ed8fdbee00109e7f6e5fefcb6 (diff) |
Merge branch 'linus' into sched/locking
Merge reason: Pick up this upstream commit:
6631e635c65d: block: don't flush plugged IO on forced preemtion scheduling
As it modifies the scheduler and we'll queue up dependent patches.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/power/Kconfig | 6 | ||||
-rw-r--r-- | kernel/sched.c | 20 |
2 files changed, 15 insertions, 11 deletions
diff --git a/kernel/power/Kconfig b/kernel/power/Kconfig index 4603f08dc47..6de9a8fc341 100644 --- a/kernel/power/Kconfig +++ b/kernel/power/Kconfig @@ -18,9 +18,13 @@ config SUSPEND_FREEZER Turning OFF this setting is NOT recommended! If in doubt, say Y. +config HIBERNATE_CALLBACKS + bool + config HIBERNATION bool "Hibernation (aka 'suspend to disk')" depends on SWAP && ARCH_HIBERNATION_POSSIBLE + select HIBERNATE_CALLBACKS select LZO_COMPRESS select LZO_DECOMPRESS ---help--- @@ -85,7 +89,7 @@ config PM_STD_PARTITION config PM_SLEEP def_bool y - depends on SUSPEND || HIBERNATION || XEN_SAVE_RESTORE + depends on SUSPEND || HIBERNATE_CALLBACKS config PM_SLEEP_SMP def_bool y diff --git a/kernel/sched.c b/kernel/sched.c index 48013633d79..a187c3fe027 100644 --- a/kernel/sched.c +++ b/kernel/sched.c @@ -4111,20 +4111,20 @@ need_resched: try_to_wake_up_local(to_wakeup); } deactivate_task(rq, prev, DEQUEUE_SLEEP); + + /* + * If we are going to sleep and we have plugged IO queued, make + * sure to submit it to avoid deadlocks. + */ + if (blk_needs_flush_plug(prev)) { + raw_spin_unlock(&rq->lock); + blk_flush_plug(prev); + raw_spin_lock(&rq->lock); + } } switch_count = &prev->nvcsw; } - /* - * If we are going to sleep and we have plugged IO queued, make - * sure to submit it to avoid deadlocks. - */ - if (prev->state != TASK_RUNNING && blk_needs_flush_plug(prev)) { - raw_spin_unlock(&rq->lock); - blk_flush_plug(prev); - raw_spin_lock(&rq->lock); - } - pre_schedule(rq, prev); if (unlikely(!rq->nr_running)) |