Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp422129ima; Wed, 24 Oct 2018 03:38:25 -0700 (PDT) X-Google-Smtp-Source: AJdET5e0wmBkteTAesvrOpoeMCg+buEsW+F8ryFIY78zvSRWq6HAwxG7JEAuVbe3VAlTzMruSYVi X-Received: by 2002:a62:444f:: with SMTP id r76-v6mr2163801pfa.111.1540377505584; Wed, 24 Oct 2018 03:38:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540377505; cv=none; d=google.com; s=arc-20160816; b=nqLC3dNPic1l50bIl8kdkERdiIk9jwPpzzmZODHwcJYbK33NGiworEFppVh7i1+c+2 xqigNIhOlX33GxBNBmeMkngCFRqAeBlbo7vh0tY/mjGWmrOst0vPyDMwzTpjmvMopjkI KXaaNh1LiGJ6srBwVK5ZatX8DpTJrXjyL/mdZ71bWV8R1pDBerPjbpKYe9fpPtGemdGF H2E8xJpC9K2sbxYT9peSlR78IPCyW2mtmsmKaPnwTe18on+danJOpSELyWGuw9dr93G/ g+SnryLv9MfqO6pYRHfQXGKmYr7BzN3KNXBJPSP3LovR5GjcQ6d7uecZTVkPkKLFLGmm zikg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=MtuGVhasCZHEB2ETTfkOygXmYw9LnufFdCKBoM3F+cM=; b=udnAWgu4h2qCXXcXNhcTjBtkYoC9BsUrrTOfXSUV3vgdhMd2IA09EfAhNUyxoAhBbQ +kFnGbUWF4cmVyfV1JVMzlanqsJpyevl+a4bdCm+FqQVXaU91bU4NMV3anqfCqnAcmwz rRzIH/OjP4AgeIxnFIQNks5v/GWifonN+59XCUdB5EquBkxJr+yPk1f0tD6kgwwUVvO3 lcDFgKAiVVa1p3c+qsHFHFqZYOyIf1vsg4mS3SHdUcfCBPHegZnGkyg66LjYqCAizR5+ txscXXgKHvYqclpgTTv66AVSQXLHQQeC9+/VmoDnVkjui9SP9vOfX8ZfrfLy1U/8xhJu xSWA== 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 l14-v6si4192903pfo.118.2018.10.24.03.38.09; Wed, 24 Oct 2018 03:38:25 -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 S1727439AbeJXTFQ (ORCPT + 99 others); Wed, 24 Oct 2018 15:05:16 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:13688 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727131AbeJXTFP (ORCPT ); Wed, 24 Oct 2018 15:05:15 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 90DBD2B0941B0; Wed, 24 Oct 2018 18:37:38 +0800 (CST) Received: from szvp000201624.huawei.com (10.120.216.130) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.408.0; Wed, 24 Oct 2018 18:37:33 +0800 From: Chao Yu To: CC: , , , Chao Yu Subject: [PATCH 3/3] f2fs: export migration_granularity sysfs entry Date: Wed, 24 Oct 2018 18:37:28 +0800 Message-ID: <20181024103728.9870-3-yuchao0@huawei.com> X-Mailer: git-send-email 2.18.0.rc1 In-Reply-To: <20181024103728.9870-1-yuchao0@huawei.com> References: <20181024103728.9870-1-yuchao0@huawei.com> 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 Add one sysfs entry to control migration granularity of GC in large section f2fs, it can be tuned to mitigate heavy overhead of migrating huge number of blocks in large section. Signed-off-by: Chao Yu --- Documentation/ABI/testing/sysfs-fs-f2fs | 9 +++++++++ fs/f2fs/sysfs.c | 7 +++++++ 2 files changed, 16 insertions(+) diff --git a/Documentation/ABI/testing/sysfs-fs-f2fs b/Documentation/ABI/testing/sysfs-fs-f2fs index 3ac41774ad3c..a7ce33199457 100644 --- a/Documentation/ABI/testing/sysfs-fs-f2fs +++ b/Documentation/ABI/testing/sysfs-fs-f2fs @@ -92,6 +92,15 @@ Contact: "Jaegeuk Kim" Description: Controls the number of trials to find a victim segment. +What: /sys/fs/f2fs//migration_granularity +Date: October 2018 +Contact: "Chao Yu" +Description: + Controls migration granularity of garbage collection on large + section, it can let GC move partial segment{s} of one section + in one GC cycle, so that dispersing heavy overhead GC to + multiple lightweight one. + What: /sys/fs/f2fs//dir_level Date: March 2014 Contact: "Jaegeuk Kim" diff --git a/fs/f2fs/sysfs.c b/fs/f2fs/sysfs.c index 240e4881279e..b393fda6d6dc 100644 --- a/fs/f2fs/sysfs.c +++ b/fs/f2fs/sysfs.c @@ -246,6 +246,11 @@ static ssize_t __sbi_store(struct f2fs_attr *a, return count; } + if (!strcmp(a->attr.name, "discard_granularity")) { + if (t == 0 || t > sbi->segs_per_sec) + return -EINVAL; + } + if (!strcmp(a->attr.name, "trim_sections")) return -EINVAL; @@ -406,6 +411,7 @@ F2FS_RW_ATTR(NM_INFO, f2fs_nm_info, ram_thresh, ram_thresh); F2FS_RW_ATTR(NM_INFO, f2fs_nm_info, ra_nid_pages, ra_nid_pages); F2FS_RW_ATTR(NM_INFO, f2fs_nm_info, dirty_nats_ratio, dirty_nats_ratio); F2FS_RW_ATTR(F2FS_SBI, f2fs_sb_info, max_victim_search, max_victim_search); +F2FS_RW_ATTR(F2FS_SBI, f2fs_sb_info, migration_granularity, migration_granularity); F2FS_RW_ATTR(F2FS_SBI, f2fs_sb_info, dir_level, dir_level); F2FS_RW_ATTR(F2FS_SBI, f2fs_sb_info, cp_interval, interval_time[CP_TIME]); F2FS_RW_ATTR(F2FS_SBI, f2fs_sb_info, idle_interval, interval_time[REQ_TIME]); @@ -460,6 +466,7 @@ static struct attribute *f2fs_attrs[] = { ATTR_LIST(min_hot_blocks), ATTR_LIST(min_ssr_sections), ATTR_LIST(max_victim_search), + ATTR_LIST(migration_granularity), ATTR_LIST(dir_level), ATTR_LIST(ram_thresh), ATTR_LIST(ra_nid_pages), -- 2.18.0.rc1