diff options
author | Jens Axboe <axboe@fb.com> | 2015-07-16 09:14:26 -0600 |
---|---|---|
committer | Jens Axboe <axboe@fb.com> | 2015-07-17 08:41:53 -0600 |
commit | 0034af036554c39eefd14d835a8ec3496ac46712 (patch) | |
tree | 54a9262ca37905600872eb8638d5453a82f59520 /include/linux/blkdev.h | |
parent | 2bb4cd5cc472b191a46938becb7dafdd44644329 (diff) | |
download | op-kernel-dev-0034af036554c39eefd14d835a8ec3496ac46712.zip op-kernel-dev-0034af036554c39eefd14d835a8ec3496ac46712.tar.gz |
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 'include/linux/blkdev.h')
-rw-r--r-- | include/linux/blkdev.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index d4068c1..243f29e 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -268,6 +268,7 @@ struct queue_limits { unsigned int io_min; unsigned int io_opt; unsigned int max_discard_sectors; + unsigned int max_hw_discard_sectors; unsigned int max_write_same_sectors; unsigned int discard_granularity; unsigned int discard_alignment; |