mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@fb.com>
To: Jeff Moyer <jmoyer@redhat.com>
Cc: <linux-kernel@vger.kernel.org>, <snitzer@redhat.com>, <hch@lst.de>
Subject: Re: [PATCH 2/3] block: make /sys/block/<dev>/queue/discard_max_bytes writeable
Date: Thu, 16 Jul 2015 09:11:28 -0600	[thread overview]
Message-ID: <55A7C9A0.5060506@fb.com> (raw)
In-Reply-To: <x49fv4orviv.fsf@segfault.boston.devel.redhat.com>

On 07/16/2015 09:07 AM, Jeff Moyer wrote:
> Jens Axboe <axboe@fb.com> writes:
>
>> 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 |  4 +++-
>>   block/blk-settings.c                |  4 ++++
>>   block/blk-sysfs.c                   | 40 ++++++++++++++++++++++++++++++++++++-
>>   include/linux/blkdev.h              |  1 +
>>   4 files changed, 47 insertions(+), 2 deletions(-)
>>
>> diff --git a/Documentation/block/queue-sysfs.txt b/Documentation/block/queue-sysfs.txt
>> index 3a29f8914df9..3748cf827131 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
>>   reported by the device. A value of '0' means device does not support
>>   the discard functionality.
>>
>> -discard_max_bytes (RO)
>> +discard_max_bytes (RW)
>>   ----------------------
>>   Devices that support discard functionality may have internal limits on
>>   the number of bytes that can be trimmed or unmapped in a single operation.
>> @@ -28,6 +28,8 @@ The discard_max_bytes parameter is set by the device driver to the maximum
>>   number of bytes that can be discarded in a single operation. Discard
>>   requests issued to the device must not exceed this limit. A discard_max_bytes
>>   value of 0 means that the device does not support discard functionality.
>> +Writing a lower value to this file can limit the maximum discard size issued
>> +to the device, which can help latencies.
>
> You forgot to add a new entry for discard_max_hw_bytes.  Fix that and
> you can slap my 'Reviewed-by: Jeff Moyer <jmoyer@redhat.com>' on there.

I thought you meant sysfs, so I had to go back and check. But 
documentation, yep, I forgot that. I'll add it. Thanks!

-- 
Jens Axboe


  reply	other threads:[~2015-07-16 15:12 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-14 18:48 [PATCH 0/3 v2] Configurable max discard size Jens Axboe
2015-07-14 18:48 ` [PATCH 1/3] block: have drivers use blk_queue_max_discard_sectors() Jens Axboe
2015-07-16 14:46   ` Jeff Moyer
2015-07-14 18:48 ` [PATCH 2/3] block: make /sys/block/<dev>/queue/discard_max_bytes writeable Jens Axboe
2015-07-16 15:07   ` Jeff Moyer
2015-07-16 15:11     ` Jens Axboe [this message]
2015-07-14 18:48 ` [PATCH 3/3] block: by default, limit maximum discard size to 64MB Jens Axboe
2015-07-14 20:44   ` Mike Snitzer
2015-07-14 20:45     ` Jens Axboe
2015-07-14 21:48       ` Jens Axboe
2015-07-15 11:46         ` Austin S Hemmelgarn
2015-07-15 15:30           ` Jens Axboe
2015-07-15 16:29             ` Mike Snitzer
2015-07-15 22:14               ` Jens Axboe
2015-08-05 13:34                 ` Mike Snitzer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=55A7C9A0.5060506@fb.com \
    --to=axboe@fb.com \
    --cc=hch@lst.de \
    --cc=jmoyer@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=snitzer@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome