* question about blk_schedule_flush_plug
@ 2011-05-23 7:05 Con Kolivas
2011-05-23 7:36 ` Peter Zijlstra
2011-05-23 7:43 ` Mike Galbraith
0 siblings, 2 replies; 3+ messages in thread
From: Con Kolivas @ 2011-05-23 7:05 UTC (permalink / raw)
To: linux-kernel; +Cc: axboe, mingo, peterz
I was looking at the scheduler changes going into 2.6.39 again and wondered
about the use of blk_schedule_flush_plug smack in the middle of schedule()
It looks like this:
if (blk_needs_flush_plug(prev)) {
raw_spin_unlock(&rq->lock);
blk_schedule_flush_plug(prev);
raw_spin_lock(&rq->lock);
}
Now call me suspicious but to my eyes it looks really dubious unlocking the
runqueue like that right in the heart of schedule().
Comments?
Thanks,
Con
--
-ck
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: question about blk_schedule_flush_plug
2011-05-23 7:05 question about blk_schedule_flush_plug Con Kolivas
@ 2011-05-23 7:36 ` Peter Zijlstra
2011-05-23 7:43 ` Mike Galbraith
1 sibling, 0 replies; 3+ messages in thread
From: Peter Zijlstra @ 2011-05-23 7:36 UTC (permalink / raw)
To: Con Kolivas; +Cc: linux-kernel, axboe, mingo
On Mon, 2011-05-23 at 17:05 +1000, Con Kolivas wrote:
> I was looking at the scheduler changes going into 2.6.39 again and wondered
> about the use of blk_schedule_flush_plug smack in the middle of schedule()
>
> It looks like this:
> if (blk_needs_flush_plug(prev)) {
> raw_spin_unlock(&rq->lock);
> blk_schedule_flush_plug(prev);
> raw_spin_lock(&rq->lock);
> }
>
> Now call me suspicious but to my eyes it looks really dubious unlocking the
> runqueue like that right in the heart of schedule().
>
> Comments?
Yeah, that's quite all-right, both pre_schedule() and idle_balance()
already did that too.
We can safely release the runqueue lock after deactivate_task() and
before put_prev_task().
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: question about blk_schedule_flush_plug
2011-05-23 7:05 question about blk_schedule_flush_plug Con Kolivas
2011-05-23 7:36 ` Peter Zijlstra
@ 2011-05-23 7:43 ` Mike Galbraith
1 sibling, 0 replies; 3+ messages in thread
From: Mike Galbraith @ 2011-05-23 7:43 UTC (permalink / raw)
To: Con Kolivas; +Cc: linux-kernel, axboe, mingo, peterz
On Mon, 2011-05-23 at 17:05 +1000, Con Kolivas wrote:
> I was looking at the scheduler changes going into 2.6.39 again and wondered
> about the use of blk_schedule_flush_plug smack in the middle of schedule()
>
> It looks like this:
> if (blk_needs_flush_plug(prev)) {
> raw_spin_unlock(&rq->lock);
> blk_schedule_flush_plug(prev);
> raw_spin_lock(&rq->lock);
> }
>
> Now call me suspicious but to my eyes it looks really dubious unlocking the
> runqueue like that right in the heart of schedule().
>
> Comments?
Releasing/retaking rq->lock is nothing new:
static void idle_balance(int this_cpu, struct rq *this_rq)
{
...
/*
* Drop the rq->lock, but keep IRQ/preempt disabled.
*/
raw_spin_unlock(&this_rq->lock);
See also need_resched, and double_lock_balance() instances.
-Mike
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-05-23 7:43 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-23 7:05 question about blk_schedule_flush_plug Con Kolivas
2011-05-23 7:36 ` Peter Zijlstra
2011-05-23 7:43 ` Mike Galbraith
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.