Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp145773pxb; Tue, 2 Feb 2021 01:17:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJxZimWll0v+PPkwrdyunJhsxGmkaOxNEA7tONhwTC19elltQ5rsRKILmcVrxsQxaOdAXRPI X-Received: by 2002:a17:906:4955:: with SMTP id f21mr21561377ejt.384.1612257449456; Tue, 02 Feb 2021 01:17:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612257449; cv=none; d=google.com; s=arc-20160816; b=MRdarrG/gKvPiSgk2qrTqFGe1CgE1f3nRItMZzTs6ZJEc7u7YNhtf11709slpRycqd nQwN0Q2qhUIBKMVOWJrDKTZ5UDHSwg5gW6f99KbnSq/S3dQ3YsJrQLGoRzTTPUANXc4B ez3bBRJyE1NL8xL1+tbLnrSekrR8n5OUPkC/+AYs4nlvcBZEj/h27tPGvZfPWRinkZta HtlVncMGRvrCAtpqExrT44XXhVgc2kF9tqIaONn9KZNdb9hj1rW9F8P4txgUBmf21kgt Q0lLlpDp7iA9hLbpvovo5K3n0Lll0dJF5DMpRlrCS+z9yddFw44WHJ3ij52eSzfgJmbE /TRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=+DLMpwQkKMDbTSKy/SqfSXE+sCaOxczgGPiSYFA/Jh8=; b=xtRcxnO7Vt3My78WNUc1KbaHWFpb3HFGO+Nr5scJlQHq5vZc4uAxRsbvy1M3LOw1K0 Y0tMEloqRnpedkzoac6b070qr3jplcv3bwSYZyTqr/8gkCvLUkFaFYygsTkL8dcBZH+v jOb2ZGD6SSR7H7dt2oygIbTymc3Dk6wxB68hFTIlM/Ungw45GIoLDskfvcsgTIOq1mXP 9ECYz6YhsbIz25Xc6fkE9d0CUNKfyWZYrl3ohadAkTMIXQpBk5IJymSOBDzQuqF8W89p +z99CaShE6vZOjns8BdPUcOaSHeI4phXK8xOz4is+7gtnseiYzITmBsvBbaTHHhkgCHa tiOg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g21si11718093edb.12.2021.02.02.01.17.04; Tue, 02 Feb 2021 01:17:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232774AbhBBJQ1 (ORCPT + 99 others); Tue, 2 Feb 2021 04:16:27 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:12064 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232807AbhBBJOe (ORCPT ); Tue, 2 Feb 2021 04:14:34 -0500 Received: from DGGEMS402-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4DVJwq4NrkzMT10; Tue, 2 Feb 2021 17:12:11 +0800 (CST) Received: from [10.136.110.154] (10.136.110.154) by smtp.huawei.com (10.3.19.202) with Microsoft SMTP Server (TLS) id 14.3.498.0; Tue, 2 Feb 2021 17:13:45 +0800 Subject: Re: [f2fs-dev] [PATCH v2] f2fs: rename checkpoint=merge mount option to checkpoint_merge To: Daeho Jeong CC: , , , Daeho Jeong References: <20210202051829.2127214-1-daeho43@gmail.com> <6f1e4639-3715-d855-951d-7c0a67fa9913@huawei.com> From: Chao Yu Message-ID: Date: Tue, 2 Feb 2021 17:13:42 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.136.110.154] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/2/2 17:07, Daeho Jeong wrote: > If I understand it correctly, the only thing I have to do now is > remove "nocheckpoint_merge" now. > Am I correct? :) For this patch, Yup. :) Thanks, > > 2021년 2월 2일 (화) 오후 5:30, Chao Yu 님이 작성: >> >> On 2021/2/2 16:02, Daeho Jeong wrote: >>> I chose the same step with "flush_merge", because it doesn't have >>> "noflush_merge". >> >> Oh, "noxxx" option was added only when we set the option by default in >> default_options(), when user want to disable the default option, it >> needs to use "noxxx" option, and then we will show this "noxxx" option >> string to user via show_options() to indicate that "noxxx" option is >> working now. >> >> Anyway I think we should fix to show "noflush_merge" option because we >> have set flush_merge by default. >> >>> Do you think we need that for both, "noflush_merge" and "nocheckpoint_merge"? >> >> For "nocheckpoint_merge", we can introduce this option only when we want >> to set "checkpoint_merge" by default. >> >> Here is the example from noinline_data: >> >> Commit 75342797988 ("f2fs: enable inline data by default") >> >> Thanks, >> >>> >>> I thought we needed to give some time to make this be turned on by >>> default. It might be a little radical. :) >>> >>> What do you think? >>> >>> 2021년 2월 2일 (화) 오후 4:40, Chao Yu 님이 작성: >>>> >>>> On 2021/2/2 13:18, Daeho Jeong wrote: >>>>> From: Daeho Jeong >>>>> >>>>> As checkpoint=merge comes in, mount option setting related to checkpoint >>>>> had been mixed up and it became hard to understand. So, I separated >>>>> this option from "checkpoint=" and made another mount option >>>>> "checkpoint_merge" for this. >>>>> >>>>> Signed-off-by: Daeho Jeong >>>>> --- >>>>> v2: renamed "checkpoint=merge" to "checkpoint_merge" >>>>> --- >>>>> Documentation/filesystems/f2fs.rst | 6 +++--- >>>>> fs/f2fs/super.c | 26 ++++++++++++++------------ >>>>> 2 files changed, 17 insertions(+), 15 deletions(-) >>>>> >>>>> diff --git a/Documentation/filesystems/f2fs.rst b/Documentation/filesystems/f2fs.rst >>>>> index d0ead45dc706..475994ed8b15 100644 >>>>> --- a/Documentation/filesystems/f2fs.rst >>>>> +++ b/Documentation/filesystems/f2fs.rst >>>>> @@ -247,9 +247,9 @@ checkpoint=%s[:%u[%]] Set to "disable" to turn off checkpointing. Set to "enabl >>>>> hide up to all remaining free space. The actual space that >>>>> would be unusable can be viewed at /sys/fs/f2fs//unusable >>>>> This space is reclaimed once checkpoint=enable. >>>>> - Here is another option "merge", which creates a kernel daemon >>>>> - and makes it to merge concurrent checkpoint requests as much >>>>> - as possible to eliminate redundant checkpoint issues. Plus, >>>>> +checkpoint_merge When checkpoint is enabled, this can be used to create a kernel >>>>> + daemon and make it to merge concurrent checkpoint requests as >>>>> + much as possible to eliminate redundant checkpoint issues. Plus, >>>>> we can eliminate the sluggish issue caused by slow checkpoint >>>>> operation when the checkpoint is done in a process context in >>>>> a cgroup having low i/o budget and cpu shares. To make this >>>>> diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c >>>>> index 56696f6cfa86..d8603e6c4916 100644 >>>>> --- a/fs/f2fs/super.c >>>>> +++ b/fs/f2fs/super.c >>>>> @@ -145,6 +145,7 @@ enum { >>>>> Opt_checkpoint_disable_cap_perc, >>>>> Opt_checkpoint_enable, >>>>> Opt_checkpoint_merge, >>>>> + Opt_nocheckpoint_merge, >>>>> Opt_compress_algorithm, >>>>> Opt_compress_log_size, >>>>> Opt_compress_extension, >>>>> @@ -215,7 +216,8 @@ static match_table_t f2fs_tokens = { >>>>> {Opt_checkpoint_disable_cap, "checkpoint=disable:%u"}, >>>>> {Opt_checkpoint_disable_cap_perc, "checkpoint=disable:%u%%"}, >>>>> {Opt_checkpoint_enable, "checkpoint=enable"}, >>>>> - {Opt_checkpoint_merge, "checkpoint=merge"}, >>>>> + {Opt_checkpoint_merge, "checkpoint_merge"}, >>>>> + {Opt_nocheckpoint_merge, "nocheckpoint_merge"}, >>>>> {Opt_compress_algorithm, "compress_algorithm=%s"}, >>>>> {Opt_compress_log_size, "compress_log_size=%u"}, >>>>> {Opt_compress_extension, "compress_extension=%s"}, >>>>> @@ -946,6 +948,9 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount) >>>>> case Opt_checkpoint_merge: >>>>> set_opt(sbi, MERGE_CHECKPOINT); >>>>> break; >>>>> + case Opt_nocheckpoint_merge: >>>>> + clear_opt(sbi, MERGE_CHECKPOINT); >>>>> + break; >>>>> #ifdef CONFIG_F2FS_FS_COMPRESSION >>>>> case Opt_compress_algorithm: >>>>> if (!f2fs_sb_has_compression(sbi)) { >>>>> @@ -1142,12 +1147,6 @@ static int parse_options(struct super_block *sb, char *options, bool is_remount) >>>>> return -EINVAL; >>>>> } >>>>> >>>>> - if (test_opt(sbi, DISABLE_CHECKPOINT) && >>>>> - test_opt(sbi, MERGE_CHECKPOINT)) { >>>>> - f2fs_err(sbi, "checkpoint=merge cannot be used with checkpoint=disable\n"); >>>>> - return -EINVAL; >>>>> - } >>>>> - >>>>> /* Not pass down write hints if the number of active logs is lesser >>>>> * than NR_CURSEG_PERSIST_TYPE. >>>>> */ >>>>> @@ -1782,7 +1781,7 @@ static int f2fs_show_options(struct seq_file *seq, struct dentry *root) >>>>> seq_printf(seq, ",checkpoint=disable:%u", >>>>> F2FS_OPTION(sbi).unusable_cap); >>>>> if (test_opt(sbi, MERGE_CHECKPOINT)) >>>>> - seq_puts(seq, ",checkpoint=merge"); >>>>> + seq_puts(seq, ",checkpoint_merge"); >>>> >>>> Other noxxx options will be shown in show_options(), how about following them? >>>> >>>>> if (F2FS_OPTION(sbi).fsync_mode == FSYNC_MODE_POSIX) >>>>> seq_printf(seq, ",fsync_mode=%s", "posix"); >>>>> else if (F2FS_OPTION(sbi).fsync_mode == FSYNC_MODE_STRICT) >>>>> @@ -1827,6 +1826,7 @@ static void default_options(struct f2fs_sb_info *sbi) >>>>> sbi->sb->s_flags |= SB_LAZYTIME; >>>>> set_opt(sbi, FLUSH_MERGE); >>>>> set_opt(sbi, DISCARD); >>>>> + clear_opt(sbi, MERGE_CHECKPOINT); >>>> >>>> Why should we clear checkpoint_merge option in default_options()? >>>> >>>> Thanks, >>>> >>>>> if (f2fs_sb_has_blkzoned(sbi)) >>>>> F2FS_OPTION(sbi).fs_mode = FS_MODE_LFS; >>>>> else >>>>> @@ -2066,9 +2066,8 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data) >>>>> } >>>>> } >>>>> >>>>> - if (!test_opt(sbi, MERGE_CHECKPOINT)) { >>>>> - f2fs_stop_ckpt_thread(sbi); >>>>> - } else { >>>>> + if (!test_opt(sbi, DISABLE_CHECKPOINT) && >>>>> + test_opt(sbi, MERGE_CHECKPOINT)) { >>>>> err = f2fs_start_ckpt_thread(sbi); >>>>> if (err) { >>>>> f2fs_err(sbi, >>>>> @@ -2076,6 +2075,8 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data) >>>>> err); >>>>> goto restore_gc; >>>>> } >>>>> + } else { >>>>> + f2fs_stop_ckpt_thread(sbi); >>>>> } >>>>> >>>>> /* >>>>> @@ -3831,7 +3832,8 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent) >>>>> >>>>> /* setup checkpoint request control and start checkpoint issue thread */ >>>>> f2fs_init_ckpt_req_control(sbi); >>>>> - if (test_opt(sbi, MERGE_CHECKPOINT)) { >>>>> + if (!test_opt(sbi, DISABLE_CHECKPOINT) && >>>>> + test_opt(sbi, MERGE_CHECKPOINT)) { >>>>> err = f2fs_start_ckpt_thread(sbi); >>>>> if (err) { >>>>> f2fs_err(sbi, >>>>> >>> . >>> > . >