All of lore.kernel.org
 help / color / mirror / Atom feed
* [f2fs-dev] [PATCH] f2fs: avoid unneeded preflush during checkpoint()
@ 2022-02-07 11:35 ` Chao Yu
  0 siblings, 0 replies; 8+ messages in thread
From: Chao Yu @ 2022-02-07 11:35 UTC (permalink / raw)
  To: jaegeuk; +Cc: linux-kernel, linux-f2fs-devel

During checkpoint, we have committed preflush command via f2fs_flush_device_cache()
to persist all metadata pages except last #2 CP pack page, so we don't need to
commit another preflush command in commit_checkpoint(), remove it to avoid unneeded
write cache overhead.

Signed-off-by: Chao Yu <chao@kernel.org>
---
 fs/f2fs/data.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 8c417864c66a..15ac18bbbc8e 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -598,7 +598,7 @@ static void __f2fs_submit_merged_write(struct f2fs_sb_info *sbi,
 		io->fio.op = REQ_OP_WRITE;
 		io->fio.op_flags = REQ_META | REQ_PRIO | REQ_SYNC;
 		if (!test_opt(sbi, NOBARRIER))
-			io->fio.op_flags |= REQ_PREFLUSH | REQ_FUA;
+			io->fio.op_flags |= REQ_FUA;
 	}
 	__submit_merged_bio(io);
 	up_write(&io->io_rwsem);
-- 
2.32.0



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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH] f2fs: avoid unneeded preflush during checkpoint()
@ 2022-02-07 11:35 ` Chao Yu
  0 siblings, 0 replies; 8+ messages in thread
From: Chao Yu @ 2022-02-07 11:35 UTC (permalink / raw)
  To: jaegeuk; +Cc: linux-f2fs-devel, linux-kernel, Chao Yu

During checkpoint, we have committed preflush command via f2fs_flush_device_cache()
to persist all metadata pages except last #2 CP pack page, so we don't need to
commit another preflush command in commit_checkpoint(), remove it to avoid unneeded
write cache overhead.

Signed-off-by: Chao Yu <chao@kernel.org>
---
 fs/f2fs/data.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
index 8c417864c66a..15ac18bbbc8e 100644
--- a/fs/f2fs/data.c
+++ b/fs/f2fs/data.c
@@ -598,7 +598,7 @@ static void __f2fs_submit_merged_write(struct f2fs_sb_info *sbi,
 		io->fio.op = REQ_OP_WRITE;
 		io->fio.op_flags = REQ_META | REQ_PRIO | REQ_SYNC;
 		if (!test_opt(sbi, NOBARRIER))
-			io->fio.op_flags |= REQ_PREFLUSH | REQ_FUA;
+			io->fio.op_flags |= REQ_FUA;
 	}
 	__submit_merged_bio(io);
 	up_write(&io->io_rwsem);
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [f2fs-dev] [PATCH] f2fs: avoid unneeded preflush during checkpoint()
  2022-02-07 11:35 ` Chao Yu
@ 2022-02-07 19:14   ` Jaegeuk Kim
  -1 siblings, 0 replies; 8+ messages in thread
From: Jaegeuk Kim @ 2022-02-07 19:14 UTC (permalink / raw)
  To: Chao Yu; +Cc: linux-kernel, linux-f2fs-devel

On 02/07, Chao Yu wrote:
> During checkpoint, we have committed preflush command via f2fs_flush_device_cache()

 787 int f2fs_flush_device_cache(struct f2fs_sb_info *sbi)
 788 {
 789         int ret = 0, i;
 790 
 791         if (!f2fs_is_multi_device(sbi))
 792                 return 0;

Seems a wrong assumption.

> to persist all metadata pages except last #2 CP pack page, so we don't need to
> commit another preflush command in commit_checkpoint(), remove it to avoid unneeded
> write cache overhead.
> 
> Signed-off-by: Chao Yu <chao@kernel.org>
> ---
>  fs/f2fs/data.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
> index 8c417864c66a..15ac18bbbc8e 100644
> --- a/fs/f2fs/data.c
> +++ b/fs/f2fs/data.c
> @@ -598,7 +598,7 @@ static void __f2fs_submit_merged_write(struct f2fs_sb_info *sbi,
>  		io->fio.op = REQ_OP_WRITE;
>  		io->fio.op_flags = REQ_META | REQ_PRIO | REQ_SYNC;
>  		if (!test_opt(sbi, NOBARRIER))
> -			io->fio.op_flags |= REQ_PREFLUSH | REQ_FUA;
> +			io->fio.op_flags |= REQ_FUA;
>  	}
>  	__submit_merged_bio(io);
>  	up_write(&io->io_rwsem);
> -- 
> 2.32.0


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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] f2fs: avoid unneeded preflush during checkpoint()
@ 2022-02-07 19:14   ` Jaegeuk Kim
  0 siblings, 0 replies; 8+ messages in thread
From: Jaegeuk Kim @ 2022-02-07 19:14 UTC (permalink / raw)
  To: Chao Yu; +Cc: linux-f2fs-devel, linux-kernel

On 02/07, Chao Yu wrote:
> During checkpoint, we have committed preflush command via f2fs_flush_device_cache()

 787 int f2fs_flush_device_cache(struct f2fs_sb_info *sbi)
 788 {
 789         int ret = 0, i;
 790 
 791         if (!f2fs_is_multi_device(sbi))
 792                 return 0;

Seems a wrong assumption.

> to persist all metadata pages except last #2 CP pack page, so we don't need to
> commit another preflush command in commit_checkpoint(), remove it to avoid unneeded
> write cache overhead.
> 
> Signed-off-by: Chao Yu <chao@kernel.org>
> ---
>  fs/f2fs/data.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
> index 8c417864c66a..15ac18bbbc8e 100644
> --- a/fs/f2fs/data.c
> +++ b/fs/f2fs/data.c
> @@ -598,7 +598,7 @@ static void __f2fs_submit_merged_write(struct f2fs_sb_info *sbi,
>  		io->fio.op = REQ_OP_WRITE;
>  		io->fio.op_flags = REQ_META | REQ_PRIO | REQ_SYNC;
>  		if (!test_opt(sbi, NOBARRIER))
> -			io->fio.op_flags |= REQ_PREFLUSH | REQ_FUA;
> +			io->fio.op_flags |= REQ_FUA;
>  	}
>  	__submit_merged_bio(io);
>  	up_write(&io->io_rwsem);
> -- 
> 2.32.0

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [f2fs-dev] [PATCH] f2fs: avoid unneeded preflush during checkpoint()
  2022-02-07 19:14   ` Jaegeuk Kim
@ 2022-02-08  1:35     ` Chao Yu
  -1 siblings, 0 replies; 8+ messages in thread
From: Chao Yu @ 2022-02-08  1:35 UTC (permalink / raw)
  To: Jaegeuk Kim; +Cc: linux-kernel, linux-f2fs-devel

On 2022/2/8 3:14, Jaegeuk Kim wrote:
> On 02/07, Chao Yu wrote:
>> During checkpoint, we have committed preflush command via f2fs_flush_device_cache()
> 
>   787 int f2fs_flush_device_cache(struct f2fs_sb_info *sbi)
>   788 {
>   789         int ret = 0, i;
>   790
>   791         if (!f2fs_is_multi_device(sbi))
>   792                 return 0;
> 
> Seems a wrong assumption.

Oh, I missed that f2fs_flush_device_cache was introduced to flush devices except
first device when multi-device feature is on.

	for (i = 1; i < sbi->s_ndevs; i++) {
		int count = DEFAULT_RETRY_IO_COUNT;

So, this patch seems wrong...

Instead, below case looks wrong since it needs to trigger flush during checkpoint()
no matter nobarrier is on or off.

	if (test_opt(sbi, NOBARRIER))
		return 0;

Thanks,

> 
>> to persist all metadata pages except last #2 CP pack page, so we don't need to
>> commit another preflush command in commit_checkpoint(), remove it to avoid unneeded
>> write cache overhead.
>>
>> Signed-off-by: Chao Yu <chao@kernel.org>
>> ---
>>   fs/f2fs/data.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
>> index 8c417864c66a..15ac18bbbc8e 100644
>> --- a/fs/f2fs/data.c
>> +++ b/fs/f2fs/data.c
>> @@ -598,7 +598,7 @@ static void __f2fs_submit_merged_write(struct f2fs_sb_info *sbi,
>>   		io->fio.op = REQ_OP_WRITE;
>>   		io->fio.op_flags = REQ_META | REQ_PRIO | REQ_SYNC;
>>   		if (!test_opt(sbi, NOBARRIER))
>> -			io->fio.op_flags |= REQ_PREFLUSH | REQ_FUA;
>> +			io->fio.op_flags |= REQ_FUA;
>>   	}
>>   	__submit_merged_bio(io);
>>   	up_write(&io->io_rwsem);
>> -- 
>> 2.32.0


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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] f2fs: avoid unneeded preflush during checkpoint()
@ 2022-02-08  1:35     ` Chao Yu
  0 siblings, 0 replies; 8+ messages in thread
From: Chao Yu @ 2022-02-08  1:35 UTC (permalink / raw)
  To: Jaegeuk Kim; +Cc: linux-f2fs-devel, linux-kernel

On 2022/2/8 3:14, Jaegeuk Kim wrote:
> On 02/07, Chao Yu wrote:
>> During checkpoint, we have committed preflush command via f2fs_flush_device_cache()
> 
>   787 int f2fs_flush_device_cache(struct f2fs_sb_info *sbi)
>   788 {
>   789         int ret = 0, i;
>   790
>   791         if (!f2fs_is_multi_device(sbi))
>   792                 return 0;
> 
> Seems a wrong assumption.

Oh, I missed that f2fs_flush_device_cache was introduced to flush devices except
first device when multi-device feature is on.

	for (i = 1; i < sbi->s_ndevs; i++) {
		int count = DEFAULT_RETRY_IO_COUNT;

So, this patch seems wrong...

Instead, below case looks wrong since it needs to trigger flush during checkpoint()
no matter nobarrier is on or off.

	if (test_opt(sbi, NOBARRIER))
		return 0;

Thanks,

> 
>> to persist all metadata pages except last #2 CP pack page, so we don't need to
>> commit another preflush command in commit_checkpoint(), remove it to avoid unneeded
>> write cache overhead.
>>
>> Signed-off-by: Chao Yu <chao@kernel.org>
>> ---
>>   fs/f2fs/data.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
>> index 8c417864c66a..15ac18bbbc8e 100644
>> --- a/fs/f2fs/data.c
>> +++ b/fs/f2fs/data.c
>> @@ -598,7 +598,7 @@ static void __f2fs_submit_merged_write(struct f2fs_sb_info *sbi,
>>   		io->fio.op = REQ_OP_WRITE;
>>   		io->fio.op_flags = REQ_META | REQ_PRIO | REQ_SYNC;
>>   		if (!test_opt(sbi, NOBARRIER))
>> -			io->fio.op_flags |= REQ_PREFLUSH | REQ_FUA;
>> +			io->fio.op_flags |= REQ_FUA;
>>   	}
>>   	__submit_merged_bio(io);
>>   	up_write(&io->io_rwsem);
>> -- 
>> 2.32.0

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [f2fs-dev] [PATCH] f2fs: avoid unneeded preflush during checkpoint()
  2022-02-08  1:35     ` Chao Yu
@ 2022-02-08  9:18       ` Chao Yu
  -1 siblings, 0 replies; 8+ messages in thread
From: Chao Yu @ 2022-02-08  9:18 UTC (permalink / raw)
  To: Jaegeuk Kim; +Cc: linux-kernel, linux-f2fs-devel

On 2022/2/8 9:35, Chao Yu wrote:
> On 2022/2/8 3:14, Jaegeuk Kim wrote:
>> On 02/07, Chao Yu wrote:
>>> During checkpoint, we have committed preflush command via f2fs_flush_device_cache()
>>
>>   787 int f2fs_flush_device_cache(struct f2fs_sb_info *sbi)
>>   788 {
>>   789         int ret = 0, i;
>>   790
>>   791         if (!f2fs_is_multi_device(sbi))
>>   792                 return 0;
>>
>> Seems a wrong assumption.
> 
> Oh, I missed that f2fs_flush_device_cache was introduced to flush devices except
> first device when multi-device feature is on.
> 
>      for (i = 1; i < sbi->s_ndevs; i++) {
>          int count = DEFAULT_RETRY_IO_COUNT;
> 
> So, this patch seems wrong...
> 
> Instead, below case looks wrong since it needs to trigger flush during checkpoint()
> no matter nobarrier is on or off.

Wrong comments, let's ignore this patch, sorry.

Thanks,

> 
>      if (test_opt(sbi, NOBARRIER))
>          return 0;
> 
> Thanks,
> 
>>
>>> to persist all metadata pages except last #2 CP pack page, so we don't need to
>>> commit another preflush command in commit_checkpoint(), remove it to avoid unneeded
>>> write cache overhead.
>>>
>>> Signed-off-by: Chao Yu <chao@kernel.org>
>>> ---
>>>   fs/f2fs/data.c | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
>>> index 8c417864c66a..15ac18bbbc8e 100644
>>> --- a/fs/f2fs/data.c
>>> +++ b/fs/f2fs/data.c
>>> @@ -598,7 +598,7 @@ static void __f2fs_submit_merged_write(struct f2fs_sb_info *sbi,
>>>           io->fio.op = REQ_OP_WRITE;
>>>           io->fio.op_flags = REQ_META | REQ_PRIO | REQ_SYNC;
>>>           if (!test_opt(sbi, NOBARRIER))
>>> -            io->fio.op_flags |= REQ_PREFLUSH | REQ_FUA;
>>> +            io->fio.op_flags |= REQ_FUA;
>>>       }
>>>       __submit_merged_bio(io);
>>>       up_write(&io->io_rwsem);
>>> -- 
>>> 2.32.0
> 
> 
> _______________________________________________
> Linux-f2fs-devel mailing list
> Linux-f2fs-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [f2fs-dev] [PATCH] f2fs: avoid unneeded preflush during checkpoint()
@ 2022-02-08  9:18       ` Chao Yu
  0 siblings, 0 replies; 8+ messages in thread
From: Chao Yu @ 2022-02-08  9:18 UTC (permalink / raw)
  To: Jaegeuk Kim; +Cc: linux-kernel, linux-f2fs-devel

On 2022/2/8 9:35, Chao Yu wrote:
> On 2022/2/8 3:14, Jaegeuk Kim wrote:
>> On 02/07, Chao Yu wrote:
>>> During checkpoint, we have committed preflush command via f2fs_flush_device_cache()
>>
>>   787 int f2fs_flush_device_cache(struct f2fs_sb_info *sbi)
>>   788 {
>>   789         int ret = 0, i;
>>   790
>>   791         if (!f2fs_is_multi_device(sbi))
>>   792                 return 0;
>>
>> Seems a wrong assumption.
> 
> Oh, I missed that f2fs_flush_device_cache was introduced to flush devices except
> first device when multi-device feature is on.
> 
>      for (i = 1; i < sbi->s_ndevs; i++) {
>          int count = DEFAULT_RETRY_IO_COUNT;
> 
> So, this patch seems wrong...
> 
> Instead, below case looks wrong since it needs to trigger flush during checkpoint()
> no matter nobarrier is on or off.

Wrong comments, let's ignore this patch, sorry.

Thanks,

> 
>      if (test_opt(sbi, NOBARRIER))
>          return 0;
> 
> Thanks,
> 
>>
>>> to persist all metadata pages except last #2 CP pack page, so we don't need to
>>> commit another preflush command in commit_checkpoint(), remove it to avoid unneeded
>>> write cache overhead.
>>>
>>> Signed-off-by: Chao Yu <chao@kernel.org>
>>> ---
>>>   fs/f2fs/data.c | 2 +-
>>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c
>>> index 8c417864c66a..15ac18bbbc8e 100644
>>> --- a/fs/f2fs/data.c
>>> +++ b/fs/f2fs/data.c
>>> @@ -598,7 +598,7 @@ static void __f2fs_submit_merged_write(struct f2fs_sb_info *sbi,
>>>           io->fio.op = REQ_OP_WRITE;
>>>           io->fio.op_flags = REQ_META | REQ_PRIO | REQ_SYNC;
>>>           if (!test_opt(sbi, NOBARRIER))
>>> -            io->fio.op_flags |= REQ_PREFLUSH | REQ_FUA;
>>> +            io->fio.op_flags |= REQ_FUA;
>>>       }
>>>       __submit_merged_bio(io);
>>>       up_write(&io->io_rwsem);
>>> -- 
>>> 2.32.0
> 
> 
> _______________________________________________
> Linux-f2fs-devel mailing list
> Linux-f2fs-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel


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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-02-08  9:18 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-07 11:35 [f2fs-dev] [PATCH] f2fs: avoid unneeded preflush during checkpoint() Chao Yu
2022-02-07 11:35 ` Chao Yu
2022-02-07 19:14 ` [f2fs-dev] " Jaegeuk Kim
2022-02-07 19:14   ` Jaegeuk Kim
2022-02-08  1:35   ` [f2fs-dev] " Chao Yu
2022-02-08  1:35     ` Chao Yu
2022-02-08  9:18     ` [f2fs-dev] " Chao Yu
2022-02-08  9:18       ` Chao Yu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.