Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 263649
b: refs/heads/master
c: 9c40cef
h: refs/heads/master
i:
  263647: 3f53963
v: v3
  • Loading branch information
Thomas Gleixner authored and Ingo Molnar committed Aug 29, 2011
1 parent 320d77f commit c0ea88b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 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: c259e01a1ec90063042f758e409cd26b2a0963c8
refs/heads/master: 9c40cef2b799f9b5e7fa5de4d2ad3a0168ba118c
25 changes: 15 additions & 10 deletions trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -4322,16 +4322,6 @@ static void __sched __schedule(void)
if (to_wakeup)
try_to_wake_up_local(to_wakeup);
}

/*
* 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_schedule_flush_plug(prev);
raw_spin_lock(&rq->lock);
}
}
switch_count = &prev->nvcsw;
}
Expand Down Expand Up @@ -4370,8 +4360,23 @@ static void __sched __schedule(void)
goto need_resched;
}

static inline void sched_submit_work(struct task_struct *tsk)
{
if (!tsk->state)
return;
/*
* 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(tsk))
blk_schedule_flush_plug(tsk);
}

asmlinkage void schedule(void)
{
struct task_struct *tsk = current;

sched_submit_work(tsk);
__schedule();
}
EXPORT_SYMBOL(schedule);
Expand Down

0 comments on commit c0ea88b

Please sign in to comment.