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.
Showing the changes to include/linux/blkdev.h (1 of 4 files). Show all
Unified · Split
| @@ -1130,6 +1130,7 @@ extern void blk_set_queue_dying(struct request_queue *); · 1129 unmodified lines | |||
| 1130 | struct blk_plug { | 1130 | struct blk_plug { |
| 1131 | struct list_head mq_list; /* blk-mq requests */ | 1131 | struct list_head mq_list; /* blk-mq requests */ |
| 1132 | struct list_head cb_list; /* md requires an unplug callback */ | 1132 | struct list_head cb_list; /* md requires an unplug callback */ |
| 1133 | unsigned short rq_count; | ||
| 1133 | }; | 1134 | }; |
| 1134 | #define BLK_MAX_REQUEST_COUNT 16 | 1135 | #define BLK_MAX_REQUEST_COUNT 16 |
| 1135 | #define BLK_PLUG_FLUSH_SIZE (128 * 1024) | 1136 | #define BLK_PLUG_FLUSH_SIZE (128 * 1024) |