aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation/block
diff options
context:
space:
mode:
authorJens Axboe <axboe@fb.com>2015-07-16 11:14:26 -0400
committerJens Axboe <axboe@fb.com>2015-07-17 10:41:53 -0400
commit0034af036554c39eefd14d835a8ec3496ac46712 (patch)
tree54a9262ca37905600872eb8638d5453a82f59520 /Documentation/block
parent2bb4cd5cc472b191a46938becb7dafdd44644329 (diff)
block: make /sys/block/<dev>/queue/discard_max_bytes writeable
Lots of devices support huge discard sizes these days. Depending on how the device handles them internally, huge discards can introduce massive latencies (hundreds of msec) on the device side. We have a sysfs file, discard_max_bytes, that advertises the max hardware supported discard size. Make this writeable, and split the settings into a soft and hard limit. This can be set from 'discard_granularity' and up to the hardware limit. Add a new sysfs file, 'discard_max_hw_bytes', that shows the hw set limit. Reviewed-by: Jeff Moyer <jmoyer@redhat.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'Documentation/block')
-rw-r--r--Documentation/block/queue-sysfs.txt10
1 files changed, 9 insertions, 1 deletions
diff --git a/Documentation/block/queue-sysfs.txt b/Documentation/block/queue-sysfs.txt
index 3a29f8914df9..e5d914845be6 100644
--- a/Documentation/block/queue-sysfs.txt
+++ b/Documentation/block/queue-sysfs.txt
@@ -20,7 +20,7 @@ This shows the size of internal allocation of the device in bytes, if
20reported by the device. A value of '0' means device does not support 20reported by the device. A value of '0' means device does not support
21the discard functionality. 21the discard functionality.
22 22
23discard_max_bytes (RO) 23discard_max_hw_bytes (RO)
24---------------------- 24----------------------
25Devices that support discard functionality may have internal limits on 25Devices that support discard functionality may have internal limits on
26the number of bytes that can be trimmed or unmapped in a single operation. 26the number of bytes that can be trimmed or unmapped in a single operation.
@@ -29,6 +29,14 @@ number of bytes that can be discarded in a single operation. Discard
29requests issued to the device must not exceed this limit. A discard_max_bytes 29requests issued to the device must not exceed this limit. A discard_max_bytes
30value of 0 means that the device does not support discard functionality. 30value of 0 means that the device does not support discard functionality.
31 31
32discard_max_bytes (RW)
33----------------------
34While discard_max_hw_bytes is the hardware limit for the device, this
35setting is the software limit. Some devices exhibit large latencies when
36large discards are issued, setting this value lower will make Linux issue
37smaller discards and potentially help reduce latencies induced by large
38discard operations.
39
32discard_zeroes_data (RO) 40discard_zeroes_data (RO)
33------------------------ 41------------------------
34When read, this file will show if the discarded block are zeroed by the 42When read, this file will show if the discarded block are zeroed by the