block: sum requests in the plug structure

This isn't exactly the same as the previous count, as it includes
requests for all devices. But that really doesn't matter, if we have
more than the threshold (16) queued up, flush it. It's not worth it
to have an expensive list loop for this.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
Jens Axboe
2018-11-23 22:04:33 -07:00
parent af78ff7c6e
commit 5f0ed774ed
4 changed files with 10 additions and 39 deletions

View File

@@ -1130,6 +1130,7 @@ extern void blk_set_queue_dying(struct request_queue *);
struct blk_plug {
struct list_head mq_list; /* blk-mq requests */
struct list_head cb_list; /* md requires an unplug callback */
unsigned short rq_count;
};
#define BLK_MAX_REQUEST_COUNT 16
#define BLK_PLUG_FLUSH_SIZE (128 * 1024)