block: make /sys/block/<dev>/queue/discard_max_bytes writeable
authorJens Axboe <axboe@fb.com>
Tue, 14 Jul 2015 18:39:34 +0000 (12:39 -0600)
committerJens Axboe <axboe@fb.com>
Tue, 14 Jul 2015 18:39:34 +0000 (12:39 -0600)
commitd4d58d2fb206c4bef37e5143a3b7be1843d5ec67
tree29f71522c3ca49c3186ba800fa785880347dcf68
parent26a475ba7f9362b3b7b63fd2ca183af9694300e9
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.

Signed-off-by: Jens Axboe <axboe@fb.com>
Documentation/block/queue-sysfs.txt
block/blk-settings.c
block/blk-sysfs.c
include/linux/blkdev.h