Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3104104imm; Fri, 10 Aug 2018 03:59:12 -0700 (PDT) X-Google-Smtp-Source: AA+uWPx6GBigFMO4SdEJ5qtkcZTVP01+aZfarTsVbb22ftT4Z6Q+yQQHlfso21cMgVPeU/mU8k4W X-Received: by 2002:a17:902:6e16:: with SMTP id u22-v6mr5599102plk.13.1533898752743; Fri, 10 Aug 2018 03:59:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533898752; cv=none; d=google.com; s=arc-20160816; b=DsFnjlpmRR5GvL3eKt5gakTUZYmV+vg6KKGU3pNZzka0zHLYb2UhCUwu5rst7KbykR BER1kunNMFeGWyduZ9NjE2Y9394XQ6g/JPoi3rNue6o0icnzyw5uyeDTykvQhu3MqE80 YGoUbh7JEJqeSzBHn2EAzuSCRhq37+yU8W2QK+9WpI5b0OTf7IXWL95aJMopBdQuxb8A 7WMY7Ontm99sSirkF0tDvDi3ktsPxg8WzSR6L+69faXo1EBcxdZUEQ42CuS8FKh4RZ51 eA82OnlWtXiCp+6pzP3mBtiGqdJ8X2lycWL/36a5D2PHR/XoDcnuvSQFEP7D3frpoxrz dH2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:arc-authentication-results; bh=FJPzz0488Goc89HwFzjMKeT56jwvySw2n+NjifR+CTI=; b=c0IxdD+8wJCKqbc8F8VkIGtOdktOhV0moWJjD1PNbXDTFYc5WYJLiz0+6WL7iSrDV7 nL4sAKvsldC4gJVeYea+4f66Sf7Bgs0jd+lDb3yMRCVjb+kNNB5aY/eoOtxaB1XPeAwa Ca+eEnfzJyfBh7yH1jbD6ZVfzPUpXzcdeAzo8bsh4cE3IAIxSIAgycpjEQU79jaxVYZs atQlccnEysgjIsSrBAbuUXuq5zwir+TlGNn98E8BeJ8lrqpM7qjwF3oo2Wzt2YywJRrg exHQbVXS18vaksKsTlCxbvG2vdN5LBHVPAbkb3Y9U9vy273npsE5Wl/kP2Y7uYdssj1l tuLw== 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 c5-v6si9492078pgk.327.2018.08.10.03.58.57; Fri, 10 Aug 2018 03:59:12 -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 S1727628AbeHJMhe (ORCPT + 99 others); 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