linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [f2fs-dev]  [PATCH] Return valid segment type in 4 head logging
@ 2019-08-07 20:54 Surbhi Palande
  2019-08-08  1:33 ` Chao Yu
  0 siblings, 1 reply; 3+ messages in thread
From: Surbhi Palande @ 2019-08-07 20:54 UTC (permalink / raw)
  To: linux-f2fs-devel; +Cc: Surbhi Palande, Jaegeuk Kim

The valid type of current segments in a 4 head logging scheme are:

CURSEG_HOT_DATA, CURSEG_COLD_DATA
CURSEG_HOT_NODE, CURSEG_HOT_NODE.

When a direct node page is not explicitly marked cold,
return CURSEG_HOT_NODE as it's segment type. 
CURSEG_WARM_NODE is not a valid segment type in a
4 head logging scheme.

Signed-off-by: Surbhi Palande <csurbhi@gmail.com>
---
 fs/f2fs/segment.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index a661ac32e829..b904b5d7b4df 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -3006,8 +3006,8 @@ static int __get_segment_type_4(struct f2fs_io_info *fio)
 		else
 			return CURSEG_COLD_DATA;
 	} else {
-		if (IS_DNODE(fio->page) && is_cold_node(fio->page))
-			return CURSEG_WARM_NODE;
+		if (IS_DNODE(fio->page) && !is_cold_node(fio->page))
+			return CURSEG_HOT_NODE;
 		else
 			return CURSEG_COLD_NODE;
 	}
-- 
2.20.1



_______________________________________________
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] 3+ messages in thread

* Re: [f2fs-dev] [PATCH] Return valid segment type in 4 head logging
  2019-08-07 20:54 [f2fs-dev] [PATCH] Return valid segment type in 4 head logging Surbhi Palande
@ 2019-08-08  1:33 ` Chao Yu
       [not found]   ` <CAMBkX3eyb9qNMeoRyNsVg5W=BkChe9Ac2YvW5a7cji8AWvrN=w@mail.gmail.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Chao Yu @ 2019-08-08  1:33 UTC (permalink / raw)
  To: Surbhi Palande, linux-f2fs-devel; +Cc: Surbhi Palande, Jaegeuk Kim

On 2019/8/8 4:54, Surbhi Palande wrote:
> The valid type of current segments in a 4 head logging scheme are:
> 
> CURSEG_HOT_DATA, CURSEG_COLD_DATA
> CURSEG_HOT_NODE, CURSEG_HOT_NODE.

I didn't see a very strong reason to force to use HOT/COLD keyword in datas
type, WARM and COLD can also separate different temperature of datas, right?

> 
> When a direct node page is not explicitly marked cold,
> return CURSEG_HOT_NODE as it's segment type. 
> CURSEG_WARM_NODE is not a valid segment type in a
> 4 head logging scheme.

AFAIK, by default, recovery will traverse and replay all regular's dnode in
linklist of warm node segment, in order to keep recovery mechanism valid, we
keep the rule of allocating warm segment for cold node (regular's dnode).

Certainly, you can change to use HOT_NODE to store cold node, however we should
adjust need_do_checkpoint() as below to trigger checkpoint for every fsync,
sadly it will cause obvious performance regression, we can't afford it.

else if (F2FS_OPTION(sbi).active_logs != 6)
	cp_reason = CP_SPEC_LOG_NUM;

Thanks,

> 
> Signed-off-by: Surbhi Palande <csurbhi@gmail.com>
> ---
>  fs/f2fs/segment.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
> index a661ac32e829..b904b5d7b4df 100644
> --- a/fs/f2fs/segment.c
> +++ b/fs/f2fs/segment.c
> @@ -3006,8 +3006,8 @@ static int __get_segment_type_4(struct f2fs_io_info *fio)
>  		else
>  			return CURSEG_COLD_DATA;
>  	} else {
> -		if (IS_DNODE(fio->page) && is_cold_node(fio->page))
> -			return CURSEG_WARM_NODE;
> +		if (IS_DNODE(fio->page) && !is_cold_node(fio->page))
> +			return CURSEG_HOT_NODE;
>  		else
>  			return CURSEG_COLD_NODE;
>  	}
> 


_______________________________________________
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] 3+ messages in thread

* Re: [f2fs-dev] [PATCH] Return valid segment type in 4 head logging
       [not found]   ` <CAMBkX3eyb9qNMeoRyNsVg5W=BkChe9Ac2YvW5a7cji8AWvrN=w@mail.gmail.com>
@ 2019-08-08  6:20     ` Chao Yu
  0 siblings, 0 replies; 3+ messages in thread
From: Chao Yu @ 2019-08-08  6:20 UTC (permalink / raw)
  To: Surbhi Palande; +Cc: Jaegeuk Kim, linux-f2fs-devel

On 2019/8/8 11:58, Surbhi Palande wrote:
> 
> 
> 
> 
> 
> 
> On Wed, Aug 7, 2019 at 6:33 PM Chao Yu <yuchao0@huawei.com
> <mailto:yuchao0@huawei.com>> wrote:
> 
>     On 2019/8/8 4:54, Surbhi Palande wrote:
>     > The valid type of current segments in a 4 head logging scheme are:
>     >
>     > CURSEG_HOT_DATA, CURSEG_COLD_DATA
>     > CURSEG_HOT_NODE, CURSEG_HOT_NODE.
> 
>     I didn't see a very strong reason to force to use HOT/COLD keyword in datas
>     type, WARM and COLD can also separate different temperature of datas, right?
> 
>     >
>     > When a direct node page is not explicitly marked cold,
>     > return CURSEG_HOT_NODE as it's segment type.
>     > CURSEG_WARM_NODE is not a valid segment type in a
>     > 4 head logging scheme.
> 
>     AFAIK, by default, recovery will traverse and replay all regular's dnode in
>     linklist of warm node segment, in order to keep recovery mechanism valid, we
>     keep the rule of allocating warm segment for cold node (regular's dnode).
> 
> 
> OK! Got it. Thanks!
> 
>  
> 
> 
>     Certainly, you can change to use HOT_NODE to store cold node, however we should
>     adjust need_do_checkpoint() as below to trigger checkpoint for every fsync,
>     sadly it will cause obvious performance regression, we can't afford it.
> 
>     else if (F2FS_OPTION(sbi).active_logs != 6)
>             cp_reason = CP_SPEC_LOG_NUM;
> 
> 
> I did not see any support in mkfs or mount for creating 4 or 2 active logs.
> Am I missing anything?

FYI

Quoted from Documentation/filesystems/f2fs.txt

active_logs=%u         Support configuring the number of active logs. In the
                       current design, f2fs supports only 2, 4, and 6 logs.
                       Default number is 6.

> 
> Best Regards,
> Surbhi.
> 
> 
>  
> 
> 
>     Thanks,
> 
>     >
>     > Signed-off-by: Surbhi Palande <csurbhi@gmail.com <mailto:csurbhi@gmail.com>>
>     > ---
>     >  fs/f2fs/segment.c | 4 ++--
>     >  1 file changed, 2 insertions(+), 2 deletions(-)
>     >
>     > diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
>     > index a661ac32e829..b904b5d7b4df 100644
>     > --- a/fs/f2fs/segment.c
>     > +++ b/fs/f2fs/segment.c
>     > @@ -3006,8 +3006,8 @@ static int __get_segment_type_4(struct f2fs_io_info
>     *fio)
>     >               else
>     >                       return CURSEG_COLD_DATA;
>     >       } else {
>     > -             if (IS_DNODE(fio->page) && is_cold_node(fio->page))
>     > -                     return CURSEG_WARM_NODE;
>     > +             if (IS_DNODE(fio->page) && !is_cold_node(fio->page))
>     > +                     return CURSEG_HOT_NODE;
>     >               else
>     >                       return CURSEG_COLD_NODE;
>     >       }
>     >
> 


_______________________________________________
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] 3+ messages in thread

end of thread, other threads:[~2019-08-08  6:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-07 20:54 [f2fs-dev] [PATCH] Return valid segment type in 4 head logging Surbhi Palande
2019-08-08  1:33 ` Chao Yu
     [not found]   ` <CAMBkX3eyb9qNMeoRyNsVg5W=BkChe9Ac2YvW5a7cji8AWvrN=w@mail.gmail.com>
2019-08-08  6:20     ` Chao Yu

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).