Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752819AbbGNP3h (ORCPT ); Tue, 14 Jul 2015 11:29:37 -0400 Received: from mx0a-00082601.pphosted.com ([67.231.145.42]:32908 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752232AbbGNP3Y (ORCPT ); Tue, 14 Jul 2015 11:29:24 -0400 Message-ID: <55A52ACA.3090201@fb.com> Date: Tue, 14 Jul 2015 09:29:14 -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: Mike Snitzer CC: , Subject: Re: [PATCH 2/2] block: make /sys/block//queue/discard_max_bytes writeable References: <1436886139-18673-1-git-send-email-axboe@fb.com> <1436886139-18673-3-git-send-email-axboe@fb.com> <20150714152332.GA5568@redhat.com> In-Reply-To: <20150714152332.GA5568@redhat.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [192.168.52.123] 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-14_07:2015-07-14,2015-07-14,1970-01-01 signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1327 Lines: 32 On 07/14/2015 09:23 AM, Mike Snitzer wrote: > On Tue, Jul 14 2015 at 11:02am -0400, > Jens Axboe wrote: > >> 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. > > Looks pretty good, but we'll lose the original discard_max_bytes once it > is changed. That information loss will prevent users from knowing what > adjustments are possible over time. > > This may be OK, but figured i'd raise it. That's true, I should have mentioned that. But if you write a higher value than the device supports, then it will be truncated to the max value that the device supports. So it's not really lost, and it was the best alternative I could think of. -- 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/