Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2632046imm; Tue, 4 Sep 2018 07:38:16 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbFvR9OSpN0dv6++N7oGbZ0c33/5BIb8gJev5JSKpqOFTln7weurWkd7eKJgwptoeORas0l X-Received: by 2002:a63:d10c:: with SMTP id k12-v6mr32079318pgg.49.1536071896472; Tue, 04 Sep 2018 07:38:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536071896; cv=none; d=google.com; s=arc-20160816; b=BdDifTv8oeANI6PaKJnqrlE7BiZun9nfJUXdZpdH3B3U3p2dKgIOiCjeREZTf9/As9 cJAUGW7mGmoAPskjduOj87s7/oS7j32Rtas5RxE6I6tiRkE0EXOvUK4s/iinGFv093Jp Dk5gNwhdOx397ruYFeT10v5Sr0GFd1P9sMda/+XmPSYAEoRHJApJ92Qw+3z0G42ObrEE lz5uUQP+uh5zhgHu8ffmnv3Lg+r6rV4IGdi13UOanMVaT8IKXgKFegz2+QCRVkDWv7Ia 8blGW45JBZxTzH7U2QH2X9f2Aw8bhCyOxiEsLYDkkvMioW08S73cotH5gn5bP1bLNxja ZNwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature :arc-authentication-results; bh=Z3R2iG+GOambTEXBDTya2Rwi0UEeTJD5Hpk1vs+OVSU=; b=wlGyIHdOqIxSg2Z2zkJxha1thz2uctdSwFnk32UniZ2McXK2R9v/E37BRMNzQB0khV bOHC5gqLkeFTru453PEWyJwCAr2VYzSrDs0YicwWaKh3w49GZwRvGd0VfEDA7rt71lIA AarXR+sbu22KpQTtorUwUvPNLIj0rKTo+QaUkWXMws+y9gLtGDhiOHxY8fWKGpgazjX8 piNoZ/nh5knXAzTfl7raaL9Nky/ODajnyY5RkuMluf2YSxxFzl4v0NjzDkP5qHuPkSXE jRlA5lBAkrKl7NbcxSHdhSLOWi5qLaeREOtvjS1JQWqNXW8cilVr8uuGatm8c8WAya/y hviw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UCyaDDCD; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j13-v6si23268049pfd.319.2018.09.04.07.38.00; Tue, 04 Sep 2018 07:38:16 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=UCyaDDCD; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727352AbeIDTBs (ORCPT + 99 others); Tue, 4 Sep 2018 15:01:48 -0400 Received: from mail-ua1-f67.google.com ([209.85.222.67]:45397 "EHLO mail-ua1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725995AbeIDTBs (ORCPT ); Tue, 4 Sep 2018 15:01:48 -0400 Received: by mail-ua1-f67.google.com with SMTP id q7-v6so3017121uam.12 for ; Tue, 04 Sep 2018 07:36:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Z3R2iG+GOambTEXBDTya2Rwi0UEeTJD5Hpk1vs+OVSU=; b=UCyaDDCD0col5RsSFwd17K5SwCiXXUFcW/3Dziu+9NyJRUTIEfKmQFC7k0W62iyWJA ctC3fkhNY15cUlHV7I152cOW11iC4e1Puzj8S1yCOKowm2XtxEmBWbRuQ+gVG3amcatw lBWahvAyddU5VPb0r6wEGVuqo+W1ZzCLhU7dZEPnHG8F0Ceo4scCZHWxFu8yJ5A/uNE8 OKYNzBFDvwsFqlTPCmZEQGHLDVeNYUradeZDFvCbcuWEiYTgMeDSYGsrgdcVf+bF+3Pi tqO6RtYF19LkvOqcZ3X4sqs6BgZ30Eidkw4Ceva7n5pE6q4SQD7LUkzUZTdCmcxaU/jT q1vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Z3R2iG+GOambTEXBDTya2Rwi0UEeTJD5Hpk1vs+OVSU=; b=bXQZheTCnjMOLKntbRRek89Xb2s8L/WGcDPG/bIMdq1o5Y1uTgf8U8upM4v5Pw1xx0 xGtDXY14zo6Om+8RvbnoY4GDhlc/o0IeP64P+2MUW24xYrQ3Ap2H+jvwQUqwh0KHxy3q LiAdYsLSgNpKWH5XaCIgt0XdcOI1P84A1n8SwCwcSnL5o7qGZxBFdrp06pULootIvpID KDq8BdFp4p8Zt2dCtClAPZ22eZykKOsUr2JfYq+HBdRPgxKhhD3qKu6IxElp8bCZxDnI KAPD/YLw3eqVm9/4cuPoPJO3Kx3jqXzPlpDlvytvf43OPtJUHHhj/Ao7CdA4G8yPHiSZ tZCQ== X-Gm-Message-State: APzg51BVbpBDWNjTDoAmHAJsljQcJQaVRGu6mooulk8e/YQViGRW50zn VIrBr9nA6bKL5G4i/o0rEDzl/51zcFzpnOOKyrE= X-Received: by 2002:a9f:318a:: with SMTP id v10-v6mr18341675uad.36.1536071785528; Tue, 04 Sep 2018 07:36:25 -0700 (PDT) MIME-Version: 1.0 References: <20180810100806.9298-1-yuchao0@huawei.com> <20180814041329.GB52730@jaegeuk-macbookpro.roam.corp.google.com> <8dd153c2-5611-728b-e4a9-0c59486f53a4@huawei.com> In-Reply-To: <8dd153c2-5611-728b-e4a9-0c59486f53a4@huawei.com> From: Ju Hyung Park Date: Tue, 4 Sep 2018 23:36:14 +0900 Message-ID: Subject: Re: [f2fs-dev] [PATCH 1/2] f2fs: set 4KB discard granularity by default To: Chao Yu Cc: Jaegeuk Kim , linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, I was wondering what would be the negatives on reducing the discard granularity 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