|
@@ -423,3 +423,67 @@ void blk_limits_io_min(struct queue_limits *limits, unsigned int min)
|
|
limits->io_min = limits->logical_block_size;
|
|
limits->io_min = limits->logical_block_size;
|
|
|
|
|
|
if (limits->io_min < limits->physical_block_size)
|
|
if (limits->io_min < limits->physical_block_size)
|
|
|
|
+ limits->io_min = limits->physical_block_size;
|
|
|
|
+}
|
|
|
|
+EXPORT_SYMBOL(blk_limits_io_min);
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * blk_queue_io_min - set minimum request size for the queue
|
|
|
|
+ * @q: the request queue for the device
|
|
|
|
+ * @min: smallest I/O size in bytes
|
|
|
|
+ *
|
|
|
|
+ * Description:
|
|
|
|
+ * Storage devices may report a granularity or preferred minimum I/O
|
|
|
|
+ * size which is the smallest request the device can perform without
|
|
|
|
+ * incurring a performance penalty. For disk drives this is often the
|
|
|
|
+ * physical block size. For RAID arrays it is often the stripe chunk
|
|
|
|
+ * size. A properly aligned multiple of minimum_io_size is the
|
|
|
|
+ * preferred request size for workloads where a high number of I/O
|
|
|
|
+ * operations is desired.
|
|
|
|
+ */
|
|
|
|
+void blk_queue_io_min(struct request_queue *q, unsigned int min)
|
|
|
|
+{
|
|
|
|
+ blk_limits_io_min(&q->limits, min);
|
|
|
|
+}
|
|
|
|
+EXPORT_SYMBOL(blk_queue_io_min);
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * blk_limits_io_opt - set optimal request size for a device
|
|
|
|
+ * @limits: the queue limits
|
|
|
|
+ * @opt: smallest I/O size in bytes
|
|
|
|
+ *
|
|
|
|
+ * Description:
|
|
|
|
+ * Storage devices may report an optimal I/O size, which is the
|
|
|
|
+ * device's preferred unit for sustained I/O. This is rarely reported
|
|
|
|
+ * for disk drives. For RAID arrays it is usually the stripe width or
|
|
|
|
+ * the internal track size. A properly aligned multiple of
|
|
|
|
+ * optimal_io_size is the preferred request size for workloads where
|
|
|
|
+ * sustained throughput is desired.
|
|
|
|
+ */
|
|
|
|
+void blk_limits_io_opt(struct queue_limits *limits, unsigned int opt)
|
|
|
|
+{
|
|
|
|
+ limits->io_opt = opt;
|
|
|
|
+}
|
|
|
|
+EXPORT_SYMBOL(blk_limits_io_opt);
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * blk_queue_io_opt - set optimal request size for the queue
|
|
|
|
+ * @q: the request queue for the device
|
|
|
|
+ * @opt: optimal request size in bytes
|
|
|
|
+ *
|
|
|
|
+ * Description:
|
|
|
|
+ * Storage devices may report an optimal I/O size, which is the
|
|
|
|
+ * device's preferred unit for sustained I/O. This is rarely reported
|
|
|
|
+ * for disk drives. For RAID arrays it is usually the stripe width or
|
|
|
|
+ * the internal track size. A properly aligned multiple of
|
|
|
|
+ * optimal_io_size is the preferred request size for workloads where
|
|
|
|
+ * sustained throughput is desired.
|
|
|
|
+ */
|
|
|
|
+void blk_queue_io_opt(struct request_queue *q, unsigned int opt)
|
|
|
|
+{
|
|
|
|
+ blk_limits_io_opt(&q->limits, opt);
|
|
|
|
+}
|
|
|
|
+EXPORT_SYMBOL(blk_queue_io_opt);
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * blk_queue_stack_limits - inherit underlying queue limits for stacked drivers
|