On 11/27/18 5:05 PM, Omar Sandoval wrote:
>> +static void blk_add_rq_to_plug(struct blk_plug *plug, struct request *rq)
>> +{
>> +    list_add_tail(&rq->queuelist, &plug->mq_list);
>> +    plug->rq_count++;
>> +    if (!plug->multiple_queues && !list_is_singular(&plug->mq_list)) {
>> +            struct request *tmp;
>> +
>> +            tmp = list_first_entry(&plug->mq_list, struct request,
>> +                                            queuelist);
>> +            if (tmp->q != rq->q)
>> +                    plug->multiple_queues = true;
> 
> Actually, I thought we want to sort whenever there are different
> software/hardware queues on the plug list, even if they're on the same
> queue?

That was the original intent, but with the tons of testing I've done
lately, the cost of sorting batches is higher than the cost we pay for
having to do multiple inserts. So I think the only sane case is >= 3
requests, and multiple queues.

-- 
Jens Axboe

Reply via email to