linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
From: Jaegeuk Kim <jaegeuk@kernel.org>
To: Chao Yu <chao@kernel.org>
Cc: linux-f2fs-devel@lists.sourceforge.net,
	linux-kernel@vger.kernel.org, Yangtao Li <frank.li@vivo.com>
Subject: Re: [f2fs-dev] [PATCH 1/4] f2fs: fix to set ipu policy
Date: Mon, 30 Jan 2023 14:29:19 -0800	[thread overview]
Message-ID: <Y9hEv09nyVAYCcNK@google.com> (raw)
In-Reply-To: <b1f8ba44-dd87-b3c1-c249-10d424c6ccd0@kernel.org>

Please adjust the comments based on v2.

On 01/28, Chao Yu wrote:
> On 2023/1/20 21:40, Yangtao Li wrote:
> > For LFS mode, it should update outplace and no need inplace update.
> > When using LFS mode for small-volume devices, IPU will not be used,
> > and the OPU writing method is actually used, but F2FS_IPU_FORCE can
> > be read from the ipu_policy node, which is different from the actual
> > situation. And after remount, ipu should be disabled when convert to
> > lfs mode, let's fix it.
> > 
> > commit bdc48fa11e46 ("checkpatch/coding-style: deprecate 80-column
> > warning") increased the limit to 100 columns. BTW modify some unnecessary
> > newlines.
> > 
> > Fixes: 84b89e5d943d ("f2fs: add auto tuning for small devices")
> > Signed-off-by: Yangtao Li <frank.li@vivo.com>
> > ---
> >   fs/f2fs/segment.h |  2 ++
> >   fs/f2fs/super.c   | 20 +++++++++-----------
> >   2 files changed, 11 insertions(+), 11 deletions(-)
> > 
> > diff --git a/fs/f2fs/segment.h b/fs/f2fs/segment.h
> > index ad6a9c19f46a..0b0eb8f03cba 100644
> > --- a/fs/f2fs/segment.h
> > +++ b/fs/f2fs/segment.h
> > @@ -670,6 +670,8 @@ static inline int utilization(struct f2fs_sb_info *sbi)
> >   #define SMALL_VOLUME_SEGMENTS	(16 * 512)	/* 16GB */
> > +#define F2FS_IPU_DISABLE	0
> > +
> >   enum {
> >   	F2FS_IPU_FORCE,
> >   	F2FS_IPU_SSR,
> > diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
> > index d8a65645ee48..ebc76683f05d 100644
> > --- a/fs/f2fs/super.c
> > +++ b/fs/f2fs/super.c
> > @@ -2272,6 +2272,9 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data)
> >   	if (err)
> >   		goto restore_opts;
> > +	if (F2FS_OPTION(sbi).fs_mode == FS_MODE_LFS)
> 
> if (f2fs_lfs_mode())
> 
> > +		SM_I(sbi)->ipu_policy = F2FS_IPU_DISABLE;
> 
> How about adding such restriction to f2fs_tuning_parameters()? For
> f2fs_remount() and __sbi_store() cases, how about returning -EINVAL if
> there is a conflict?
> 
> Thanks,
> 
> > +
> >   	/*
> >   	 * Previous and new state of filesystem is RO,
> >   	 * so skip checking GC and FLUSH_MERGE conditions.
> > @@ -4080,10 +4083,9 @@ static void f2fs_tuning_parameters(struct f2fs_sb_info *sbi)
> >   	/* adjust parameters according to the volume size */
> >   	if (MAIN_SEGS(sbi) <= SMALL_VOLUME_SEGMENTS) {
> >   		if (f2fs_block_unit_discard(sbi))
> > -			SM_I(sbi)->dcc_info->discard_granularity =
> > -						MIN_DISCARD_GRANULARITY;
> > -		SM_I(sbi)->ipu_policy = BIT(F2FS_IPU_FORCE) |
> > -					BIT(F2FS_IPU_HONOR_OPU_WRITE);
> > +			SM_I(sbi)->dcc_info->discard_granularity = MIN_DISCARD_GRANULARITY;
> > +		if (F2FS_OPTION(sbi).fs_mode != FS_MODE_LFS)
> > +			SM_I(sbi)->ipu_policy = BIT(F2FS_IPU_FORCE) | BIT(F2FS_IPU_HONOR_OPU_WRITE);
> >   	}
> >   	sbi->readdir_ra = true;
> > @@ -4310,9 +4312,7 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
> >   			test_opt(sbi, MERGE_CHECKPOINT)) {
> >   		err = f2fs_start_ckpt_thread(sbi);
> >   		if (err) {
> > -			f2fs_err(sbi,
> > -			    "Failed to start F2FS issue_checkpoint_thread (%d)",
> > -			    err);
> > +			f2fs_err(sbi, "Failed to start F2FS issue_checkpoint_thread (%d)", err);
> >   			goto stop_ckpt_thread;
> >   		}
> >   	}
> > @@ -4320,14 +4320,12 @@ static int f2fs_fill_super(struct super_block *sb, void *data, int silent)
> >   	/* setup f2fs internal modules */
> >   	err = f2fs_build_segment_manager(sbi);
> >   	if (err) {
> > -		f2fs_err(sbi, "Failed to initialize F2FS segment manager (%d)",
> > -			 err);
> > +		f2fs_err(sbi, "Failed to initialize F2FS segment manager (%d)", err);
> >   		goto free_sm;
> >   	}
> >   	err = f2fs_build_node_manager(sbi);
> >   	if (err) {
> > -		f2fs_err(sbi, "Failed to initialize F2FS node manager (%d)",
> > -			 err);
> > +		f2fs_err(sbi, "Failed to initialize F2FS node manager (%d)", err);
> >   		goto free_nm;
> >   	}


_______________________________________________
Linux-f2fs-devel mailing list
Linux-f2fs-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

      reply	other threads:[~2023-01-30 22:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-20 13:40 [f2fs-dev] [PATCH 1/4] f2fs: fix to set ipu policy Yangtao Li via Linux-f2fs-devel
2023-01-20 13:40 ` [f2fs-dev] [PATCH 2/4] f2fs: add sanity check for ipu_policy Yangtao Li via Linux-f2fs-devel
2023-01-28  9:27   ` Chao Yu
2023-01-20 13:40 ` [f2fs-dev] [PATCH 3/4] f2fs: introduce ipu_mode sysfs node Yangtao Li via Linux-f2fs-devel
2023-01-28  9:37   ` Chao Yu
2023-01-20 13:40 ` [f2fs-dev] [PATCH 4/4] f2fs: move ipu_policy definitions to separated file Yangtao Li via Linux-f2fs-devel
2023-01-28  9:54   ` Chao Yu
2023-01-28  9:24 ` [f2fs-dev] [PATCH 1/4] f2fs: fix to set ipu policy Chao Yu
2023-01-30 22:29   ` Jaegeuk Kim [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y9hEv09nyVAYCcNK@google.com \
    --to=jaegeuk@kernel.org \
    --cc=chao@kernel.org \
    --cc=frank.li@vivo.com \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).