diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/blkdev.h | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index c712efdafc3f..1978655faa3b 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -860,17 +860,23 @@ struct request_queue *blk_alloc_queue_node(gfp_t, int); | |||
860 | extern void blk_put_queue(struct request_queue *); | 860 | extern void blk_put_queue(struct request_queue *); |
861 | 861 | ||
862 | /* | 862 | /* |
863 | * Note: Code in between changing the blk_plug list/cb_list or element of such | 863 | * blk_plug permits building a queue of related requests by holding the I/O |
864 | * lists is preemptable, but such code can't do sleep (or be very careful), | 864 | * fragments for a short period. This allows merging of sequential requests |
865 | * otherwise data is corrupted. For details, please check schedule() where | 865 | * into single larger request. As the requests are moved from a per-task list to |
866 | * blk_schedule_flush_plug() is called. | 866 | * the device's request_queue in a batch, this results in improved scalability |
867 | * as the lock contention for request_queue lock is reduced. | ||
868 | * | ||
869 | * It is ok not to disable preemption when adding the request to the plug list | ||
870 | * or when attempting a merge, because blk_schedule_flush_list() will only flush | ||
871 | * the plug list when the task sleeps by itself. For details, please see | ||
872 | * schedule() where blk_schedule_flush_plug() is called. | ||
867 | */ | 873 | */ |
868 | struct blk_plug { | 874 | struct blk_plug { |
869 | unsigned long magic; | 875 | unsigned long magic; /* detect uninitialized use-cases */ |
870 | struct list_head list; | 876 | struct list_head list; /* requests */ |
871 | struct list_head cb_list; | 877 | struct list_head cb_list; /* md requires an unplug callback */ |
872 | unsigned int should_sort; | 878 | unsigned int should_sort; /* list to be sorted before flushing? */ |
873 | unsigned int count; | 879 | unsigned int count; /* number of queued requests */ |
874 | }; | 880 | }; |
875 | #define BLK_MAX_REQUEST_COUNT 16 | 881 | #define BLK_MAX_REQUEST_COUNT 16 |
876 | 882 | ||