Re: [PATCH 2/7] blk-mq: abstract out blk_mq_dispatch_rq_list() helper

From: Bart Van Assche
Date: Tue Dec 13 2016 - 04:30:23 EST


On 12/13/2016 10:18 AM, Ritesh Harjani wrote:
On 12/9/2016 1:43 AM, Jens Axboe wrote:
+ if (!list_empty_careful(&hctx->dispatch)) {
+ spin_lock(&hctx->lock);
+ if (!list_empty(&hctx->dispatch))
list_splice_init already checks for list_empty. So this may be
redundant. Please check.

Hello Ritesh,

I think the list_empty() check is on purpose and is intended as a performance optimization.

Bart.