Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755359AbbGPPMH (ORCPT ); Thu, 16 Jul 2015 11:12:07 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:50030 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753331AbbGPPMF (ORCPT ); Thu, 16 Jul 2015 11:12:05 -0400 Message-ID: <55A7C9A0.5060506@fb.com> Date: Thu, 16 Jul 2015 09:11:28 -0600 From: Jens Axboe User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Jeff Moyer CC: , , Subject: Re: [PATCH 2/3] block: make /sys/block//queue/discard_max_bytes writeable References: <1436899703-31966-1-git-send-email-axboe@fb.com> <1436899703-31966-3-git-send-email-axboe@fb.com> In-Reply-To: Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [192.168.54.13] X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.14.151,1.0.33,0.0.0000 definitions=2015-07-16_05:2015-07-16,2015-07-16,1970-01-01 signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2618 Lines: 57 On 07/16/2015 09:07 AM, Jeff Moyer wrote: > Jens Axboe 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 >> --- >> 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 ' 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/