Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3272695imm; Tue, 4 Sep 2018 19:34:54 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbbvWoR/uJvFEhD0p8cUXho9S2E0NQbjVIwmC/fJCY2F4kJEeDaXoXZc887bwPnGCYu4WHj X-Received: by 2002:a63:ac11:: with SMTP id v17-v6mr33934478pge.196.1536114894255; Tue, 04 Sep 2018 19:34:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536114894; cv=none; d=google.com; s=arc-20160816; b=uRmPHuztrDZrHfqY4oLkueAPm6JGADqG4QgdYF/EeycbLV6bAVbcgYlKL7B6Pf4fEW RozxhCr6QIMsIEJxLpD43oXOnVmVut2YoF0Wd4CNr7dUOEhZA3T28frHigdMJpOzj24z l0IEDHCN+nPB27qW7XTp80u7MAWEb3F6PLcYgg3oo27ly44obTLkIyeKI5iJZpvJRF9s 0DNm4O/84GlP+N431jmrVyfLWUdFzVASOspYzTRL1jvpaMI+lNUgXmC9G/sntEYUU8/Q jPiwIcfhhxrjy3lVtaoj5Q3YcILVxa74M2GRogDODhjCQscSKBLOJqRRj3TrGxoQYa9/ G02w== 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; bh=BaDcxQc2x7cIdMMl2oxQ7SW8W9jxY1pc/2pM9PnqK4s=; b=FGk41r0kMsQ1DPvdi46nZyqQhhVTol11Hg7KF5pI3JVtkSSH7AU2vZRrP+NL0aR6lo HzQZNDTNHWs3vper/UPvKaHAh0ER9CubcSol6vZzYzcUR3bcTsXI1JB+//KICKu69f8W o/hewHlHU1+Eg/aP2/IvUzIzfsy/wcGnLvP5/CpFPzBSVdulgtLUBqT4VSYm0v+Q1Z/5 uJzyTi4Rav4PXUTzT7ahEafW2AWPo0+WrCn0/cIYWDywubJeJ2g7WdltCx5SeKsj0c5Y JkkOnSz6uzI4kqrHivc5lnJCAYSTpB6y1L2NQA4dn1QkcJP0NEvFXjsQn2DVA/P/O4bR XL4g== 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 7-v6si603380pgq.637.2018.09.04.19.34.38; Tue, 04 Sep 2018 19:34:54 -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 S1727217AbeIEHBC (ORCPT + 99 others); Wed, 5 Sep 2018 03:01:02 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:45737 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725908AbeIEHBB (ORCPT ); Wed, 5 Sep 2018 03:01:01 -0400 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 134511F8E1B6A; Wed, 5 Sep 2018 10:33:05 +0800 (CST) Received: from [127.0.0.1] (10.134.22.195) by DGGEMS402-HUB.china.huawei.com (10.3.19.202) with Microsoft SMTP Server id 14.3.399.0; Wed, 5 Sep 2018 10:33:01 +0800 Subject: Re: [f2fs-dev] [PATCH 1/2] f2fs: set 4KB discard granularity by default To: Ju Hyung Park CC: Jaegeuk Kim , , References: <20180810100806.9298-1-yuchao0@huawei.com> <20180814041329.GB52730@jaegeuk-macbookpro.roam.corp.google.com> <8dd153c2-5611-728b-e4a9-0c59486f53a4@huawei.com> From: Chao Yu Message-ID: <548cb018-6d89-9552-34ee-e22cf4182ec5@huawei.com> Date: Wed, 5 Sep 2018 10:33:01 +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: Content-Type: text/plain; charset="utf-8" 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 Hi, On 2018/9/4 22:36, Ju Hyung Park wrote: > Hi, > > I was wondering what would be the negatives on reducing the discard granularity We may send more small-sized discard, which cost more IO times and lifetime, but without this, we may heap up too many undiscard pages in device, it can make write GC slower and cost more flash lifetime. Thanks, > other than making discard more aggressive(hence higher overhead and latency?). > > Thanks. > > On Tue, Aug 14, 2018 at 4:08 PM Chao Yu wrote: >> >> 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 >>> >>> . >>> >> >> >> ------------------------------------------------------------------------------ >> Check out the vibrant tech community on one of the world's most >> engaging tech sites, Slashdot.org! http://sdm.link/slashdot >> _______________________________________________ >> Linux-f2fs-devel mailing list >> Linux-f2fs-devel@lists.sourceforge.net >> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel > > . >