Received: by 2002:a4a:311b:0:0:0:0:0 with SMTP id k27-v6csp4089194ooa; Tue, 14 Aug 2018 00:32:19 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyY9178iDNmW7y1rklKyQW3A2L59RM+ccuA4V3mKKrkckDCO0Gt+ZMht/10k5HIxE1yowr9 X-Received: by 2002:a17:902:76c7:: with SMTP id j7-v6mr19410105plt.275.1534231939859; Tue, 14 Aug 2018 00:32:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534231939; cv=none; d=google.com; s=arc-20160816; b=RW54mOTNi+BnSgzw6jp3QKFK/yrxTAOsxze3cK990IZsU0rFnbK4MTt3kgKjGGD+hz pr2Y9cM4QrywoGnE4+sSv5gkTEUXPFEQSEpCb0UlXPm9iJDz1rVxJyeNtV1RlSwD+RsB GcVDHwZ2YSRXkt604zl1bSueSOqM4Z7OXetn+7oP3gJLS2dyR0hytGbblQlGbBjt5qPe FwOimevXl7bwQ+Cm50G448nK6kYLGgPwXfDxvJTQxfy2CFyfr+pq8sJodQudKDP9WLnq rWpiUKt+Ls+rEOBeDAMXoGaLFclE9LC0jjOwuHOFZki9zyJNT6GZiSnNve3hIJcyQU+S UVag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=3XWgZpcjeU6kYSEnxDYOBhWuK29QZ+x1JDXs6kn8d4w=; b=kMcwbh/pgn779GVnIkh8SqiSd+WKrwwqRxfX5YO2h96bFKbX8WLHbfqW8zDM4rLjUW 067JqS0uG7/XZ0vNDXSVXHglKIrE6VSnUyb0Y1fG3665FqjNupHIm0nEuEuIphhtdyVT Ec11P0qKyAaC0cyrMz0V2JIHs5v+5E5KVQ99E5q8wPmzmyW0kIR8GVzhmsKx16O+j5OL 1M4qKzCUrmPva9MsGNMpnh9BnILDdWovZJ4G8RIuAP190Ctbx3KOzzaF9mW8p+IOTdaO 0D1sw/hOLu9r+8ABPcBIg3Bsqykn6wkgnSn4ThRtJXwlWIaNiD2WmUWYPcXh6E0URrgx cRUA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l20-v6si17253829pgo.471.2018.08.14.00.32.04; Tue, 14 Aug 2018 00:32:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731556AbeHNJyU (ORCPT + 99 others); Tue, 14 Aug 2018 05:54:20 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:11104 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727670AbeHNJyU (ORCPT ); Tue, 14 Aug 2018 05:54:20 -0400 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 61372DAA5771C; Tue, 14 Aug 2018 15:08:23 +0800 (CST) Received: from [127.0.0.1] (10.134.22.195) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.399.0; Tue, 14 Aug 2018 15:08:21 +0800 Subject: Re: [PATCH 1/2] f2fs: set 4KB discard granularity by default To: Jaegeuk Kim CC: , , References: <20180810100806.9298-1-yuchao0@huawei.com> <20180814041329.GB52730@jaegeuk-macbookpro.roam.corp.google.com> From: Chao Yu Message-ID: <8dd153c2-5611-728b-e4a9-0c59486f53a4@huawei.com> Date: Tue, 14 Aug 2018 15:08:20 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180814041329.GB52730@jaegeuk-macbookpro.roam.corp.google.com> Content-Type: text/plain; charset="windows-1252" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.134.22.195] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/8/14 12:13, Jaegeuk Kim wrote: > On 08/10, Chao Yu wrote: >> Small granularity (size < 64K) fragmentation will cause f2fs suspending >> all pending discards, result in performance regression, so let's set >> 4KB discard granularity by default. >> >> So that without fstrim, we also have the ability to avoid any performance >> regression caused by non-alignment mapping between fs and flash device. > > This is why we added a sysfs entry. Why do we need to change the default > value every time? Of course, I didn't forget it. But, mostly, our user didn't know very well about our filesystem including each configuration's meaning, mechanism, or usage scenario, most of the time, they will choose to test f2fs with all default option, and then make the conclusion. Currently, with default 64k granularity, if we simulate fragmentation scenario of filesystem, like by a)writing 4k file and b)deleting even indexing file, then all 4k discards won't be issued, result in exhaustion of free space of flash storage, and performance degradation. So I think we'd better to consider and set default value of configuration more elaborately to avoid obvious weakness. Thoughts? Thanks, > >> >> Signed-off-by: Chao Yu >> --- >> fs/f2fs/f2fs.h | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h >> index 58431b9bfd8f..273ffdaf4891 100644 >> --- a/fs/f2fs/f2fs.h >> +++ b/fs/f2fs/f2fs.h >> @@ -248,7 +248,7 @@ struct discard_entry { >> }; >> >> /* default discard granularity of inner discard thread, unit: block count */ >> -#define DEFAULT_DISCARD_GRANULARITY 16 >> +#define DEFAULT_DISCARD_GRANULARITY 1 >> >> /* max discard pend list number */ >> #define MAX_PLIST_NUM 512 >> -- >> 2.18.0.rc1 > > . >