]> git.baikalelectronics.ru Git - kernel.git/commit
block: make /sys/block/<dev>/queue/discard_max_bytes writeable
authorJens Axboe <axboe@fb.com>
Thu, 16 Jul 2015 15:14:26 +0000 (09:14 -0600)
committerJens Axboe <axboe@fb.com>
Fri, 17 Jul 2015 14:41:53 +0000 (08:41 -0600)
commitb244f338443c0cc2e7500c617d27dab2441b1a31
tree54a9262ca37905600872eb8638d5453a82f59520
parent673bdf37672936bc4762d0d54d3d73595eabeb81
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>
Documentation/block/queue-sysfs.txt
block/blk-settings.c
block/blk-sysfs.c
include/linux/blkdev.h