From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 349C6C4646D for ; Fri, 10 Aug 2018 10:08:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E365B223E8 for ; Fri, 10 Aug 2018 10:08:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E365B223E8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727653AbeHJMhe (ORCPT ); Fri, 10 Aug 2018 08:37:34 -0400 Received: from szxga07-in.huawei.com ([45.249.212.35]:53523 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726963AbeHJMhe (ORCPT ); Fri, 10 Aug 2018 08:37:34 -0400 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 261BBFC8F3DC; Fri, 10 Aug 2018 18:08:18 +0800 (CST) Received: from szvp000201624.huawei.com (10.120.216.130) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.399.0; Fri, 10 Aug 2018 18:08:10 +0800 From: Chao Yu To: CC: , , , Chao Yu Subject: [PATCH 1/2] f2fs: set 4KB discard granularity by default Date: Fri, 10 Aug 2018 18:08:05 +0800 Message-ID: <20180810100806.9298-1-yuchao0@huawei.com> X-Mailer: git-send-email 2.18.0.rc1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.120.216.130] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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