[PATCH 1/3] block: avoid unnecessary plug should_sort test.
If request_count >= BLK_MAX_REQUEST_COUNT,then it will exec blk_flush_plug_list which plug all request.So no need to do plug->should_sort test. Signed-off-by: Jianpeng Ma --- block/blk-core.c |9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/block/blk-core.c b/block/blk-core.c index 4b4dbdf..7a3abc6 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -1514,17 +1514,16 @@ get_rq: if (list_empty(>list)) trace_block_plug(q); else { - if (!plug->should_sort) { + if (request_count >= BLK_MAX_REQUEST_COUNT) { + blk_flush_plug_list(plug, false); + trace_block_plug(q); + } else if (!plug->should_sort) { struct request *__rq; __rq = list_entry_rq(plug->list.prev); if (__rq->q != q) plug->should_sort = 1; } - if (request_count >= BLK_MAX_REQUEST_COUNT) { - blk_flush_plug_list(plug, false); - trace_block_plug(q); - } } list_add_tail(>queuelist, >list); drive_stat_acct(req, 1); -- 1.7.9.5 N�Р骒r��yb�X�肚�v�^�)藓{.n�+�伐�{��赙zXФ�≤�}��财�z�:+v�����赙zZ+��+zf"�h���~i���z��wア�?�ㄨ��&�)撷f��^j谦y�m��@A�a囤� 0鹅h���i
[PATCH 1/3] block: avoid unnecessary plug should_sort test.
If request_count = BLK_MAX_REQUEST_COUNT,then it will exec blk_flush_plug_list which plug all request.So no need to do plug-should_sort test. Signed-off-by: Jianpeng Ma majianp...@gmail.com --- block/blk-core.c |9 - 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/block/blk-core.c b/block/blk-core.c index 4b4dbdf..7a3abc6 100644 --- a/block/blk-core.c +++ b/block/blk-core.c @@ -1514,17 +1514,16 @@ get_rq: if (list_empty(plug-list)) trace_block_plug(q); else { - if (!plug-should_sort) { + if (request_count = BLK_MAX_REQUEST_COUNT) { + blk_flush_plug_list(plug, false); + trace_block_plug(q); + } else if (!plug-should_sort) { struct request *__rq; __rq = list_entry_rq(plug-list.prev); if (__rq-q != q) plug-should_sort = 1; } - if (request_count = BLK_MAX_REQUEST_COUNT) { - blk_flush_plug_list(plug, false); - trace_block_plug(q); - } } list_add_tail(req-queuelist, plug-list); drive_stat_acct(req, 1); -- 1.7.9.5 N�Р骒r��yb�X�肚�v�^�)藓{.n�+�伐�{��赙zXФ�≤�}��财�z�j:+v�����赙zZ+��+zf"�h���~i���z��wア�?�ㄨ���)撷f��^j谦y�m��@A�a囤� 0鹅h���i