Re: [PATCH 05/10] block: remove per-queue plugging

From: Jens Axboe
Date: Tue Mar 08 2011 - 04:41:23 EST


On 2011-03-08 10:38, Peter Zijlstra wrote:
> On Mon, 2011-03-07 at 21:46 +0100, Jens Axboe wrote:
>>
>> Great, that'll work for me! Your patch should work as-is, then. Thanks
>> Peter.
>
> Well I think it would be good to write it like:
>
> if (prev->state != TASK_RUNNING && blkneeds_flush(prev)) {
> raw_spin_unlock(&rq->lock);
> blk_flush_plug(prev);
> raw_spin_lock(&rq->lock);
> }
>
> To avoid flipping that lock when we don't have to.

Yes good point, in any case the need to flush will be an unlikely event.
So saving the lock/unlock dance for when we really need it is a good
optimization.

--
Jens Axboe

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/