Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp1350358ima; Wed, 24 Oct 2018 20:03:04 -0700 (PDT) X-Google-Smtp-Source: AJdET5cd35sjHHPfoWkF0496fm7xkM/bTsWIFfJSBKXU4bDEJ10yMTk3Zd3V1t/LC+BtFr62o4p/ X-Received: by 2002:a63:f960:: with SMTP id q32-v6mr4781304pgk.213.1540436584681; Wed, 24 Oct 2018 20:03:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540436584; cv=none; d=google.com; s=arc-20160816; b=FKRIe03I4ztFu6jqVKaEYTZSzxvzxQ6+oJJV0lSyFuLHcIw0qghciaA6bK1Pf4Jp5W aBwpsMz0r9cdRBg7zdcPqOgYC5Vx196iZzX4crppMTQ6XA2DotEN3LlNkq5alLtQ8iBR Y264qP8aTTUwk1alKnX4zJML+Cj0dKoq18EaelnHPPtTAQZpRYPA8UpcnQMWUC3PotpB b2PCwZY9+iSQ4xF1QTKJaHlWic9F3aa2zDtv2JJ7ZLytAV5qLVtER5ARu4QD/9Cg2bOX yd/0WHxVK4pL14HwzcGVVo4AynM+uzdP3caLOlvHvrXuLFX2XKbzMisjihgWGT/UPRgn flnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=8yhjiOkAvb806/WSXS6PYBuQXyEIfed+HWS2uDLfsvk=; b=H6FPC97821dsFXVWogE0iXk6GKvf7cmASCnPwAVcGGF1cKcazq0rl6aReKQllaj3VQ kHqUuLe3pjaA/yvG+RpqoivdiyOgB4Bb59X+duiC35SG2yQYxjF12H15EEUIZLX/a7uF q2jU6bfRyLwONo4JuzVN2dYUQaQJHRLU5fJUocgkzg1qd0pPGiAQFlbqDM21vZy2HAHU DyJMogaPT9gBBSvajIHHeWLV7i3F9h5xgEAQHTlCz9jc1qJValCsXw3TORG82Vl5ub56 Ssohm+hxtfG+4DthYzHDLub3a67xCVc9cCSQ6yjzNtm69Vxa+IzDL/tcPZRS/rfqj0Rq wdhw== 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 o24-v6si6214282pgv.242.2018.10.24.20.02.33; Wed, 24 Oct 2018 20:03:04 -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 S1726803AbeJYLcp (ORCPT + 99 others); Thu, 25 Oct 2018 07:32:45 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:41475 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726344AbeJYLco (ORCPT ); Thu, 25 Oct 2018 07:32:44 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 17DAA6A7EB076; Thu, 25 Oct 2018 11:01:56 +0800 (CST) Received: from [127.0.0.1] (10.111.220.140) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.408.0; Thu, 25 Oct 2018 11:01:49 +0800 Subject: Re: [PATCH 3/3] f2fs: export migration_granularity sysfs entry To: Chao Yu , CC: , , References: <20181024103728.9870-1-yuchao0@huawei.com> <20181024103728.9870-3-yuchao0@huawei.com> From: Yunlong Song Message-ID: Date: Thu, 25 Oct 2018 11:01:35 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <20181024103728.9870-3-yuchao0@huawei.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [10.111.220.140] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/10/24 18:37, Chao Yu wrote: > 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")) { Should be migration_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), -- Thanks, Yunlong Song