linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] f2fs: change write_hint for hot/warm nodes
       [not found] <CGME20201103083832epcms2p6c8b0e4470f1392772317ab2b25256b3d@epcms2p6>
@ 2020-11-03  8:38 ` Daejun Park
  2020-11-03  9:01   ` Chao Yu
  2020-11-03 18:58   ` Jaegeuk Kim
  0 siblings, 2 replies; 4+ messages in thread
From: Daejun Park @ 2020-11-03  8:38 UTC (permalink / raw)
  To: jaegeuk, chao, Daejun Park
  Cc: linux-kernel, linux-f2fs-devel, Chao Yu, yongmyung lee,
	Jieon Seol, Sang-yoon Oh, Mankyu PARK, Sung-Jun Park,
	Keoseong Park, SEUNGUK SHIN, Jinyoung CHOI, Jaemyung Lee

In the fs-based mode of F2FS, the mapping of hot/warm node to
WRITE_LIFE_NOT_SET should be changed to WRITE_LIFE_SHORT.

As a result of analyzing the write pattern of f2fs using real workload,
hot/warm nodes have high update ratio close to hot data.[*]
However, F2FS passes write hints for hot/warm nodes as WRITE_LIFE_NOT_SET.

Furthermore, WRITE_LIFE_NOT_SET is a default value of write hint when it is
not provided from the file system.
In storage, write_hint is used to distinguish streams (e.g. NVMe).
So, the hot/warm node of F2FS is not distinguished from other write_hints,
which can make the wrong stream seperation.

* Liang, Yu, et al. "An empirical study of F2FS on mobile devices." 2017
IEEE 23rd International Conference on Embedded and Real-Time Computing
Systems and Applications (RTCSA).

Signed-off-by: Daejun Park <daejun7.park@samsung.com>
---
v2: update documentation and comments
---
 Documentation/filesystems/f2fs.rst | 4 ++--
 fs/f2fs/segment.c                  | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/Documentation/filesystems/f2fs.rst b/Documentation/filesystems/f2fs.rst
index b8ee761c9922..afa3da7cfade 100644
--- a/Documentation/filesystems/f2fs.rst
+++ b/Documentation/filesystems/f2fs.rst
@@ -717,8 +717,8 @@ WRITE_LIFE_LONG       "                        WRITE_LIFE_LONG
 ===================== ======================== ===================
 User                  F2FS                     Block
 ===================== ======================== ===================
-                      META                     WRITE_LIFE_MEDIUM;
-                      HOT_NODE                 WRITE_LIFE_NOT_SET
+                      META                     WRITE_LIFE_MEDIUM
+                      HOT_NODE                 WRITE_LIFE_SHORT
                       WARM_NODE                "
                       COLD_NODE                WRITE_LIFE_NONE
 ioctl(COLD)           COLD_DATA                WRITE_LIFE_EXTREME
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 1596502f7375..577ab7516c6b 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -3160,8 +3160,8 @@ int f2fs_rw_hint_to_seg_type(enum rw_hint hint)
  *
  * User                  F2FS                     Block
  * ----                  ----                     -----
- *                       META                     WRITE_LIFE_MEDIUM;
- *                       HOT_NODE                 WRITE_LIFE_NOT_SET
+ *                       META                     WRITE_LIFE_MEDIUM
+ *                       HOT_NODE                 WRITE_LIFE_SHORT
  *                       WARM_NODE                "
  *                       COLD_NODE                WRITE_LIFE_NONE
  * ioctl(COLD)           COLD_DATA                WRITE_LIFE_EXTREME
@@ -3208,7 +3208,7 @@ enum rw_hint f2fs_io_type_to_rw_hint(struct f2fs_sb_info *sbi,
 				return WRITE_LIFE_EXTREME;
 		} else if (type == NODE) {
 			if (temp == WARM || temp == HOT)
-				return WRITE_LIFE_NOT_SET;
+				return WRITE_LIFE_SHORT;
 			else if (temp == COLD)
 				return WRITE_LIFE_NONE;
 		} else if (type == META) {
-- 
2.25.1


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

* Re: [PATCH v2] f2fs: change write_hint for hot/warm nodes
  2020-11-03  8:38 ` [PATCH v2] f2fs: change write_hint for hot/warm nodes Daejun Park
@ 2020-11-03  9:01   ` Chao Yu
  2020-11-03 18:58   ` Jaegeuk Kim
  1 sibling, 0 replies; 4+ messages in thread
From: Chao Yu @ 2020-11-03  9:01 UTC (permalink / raw)
  To: daejun7.park, jaegeuk, chao
  Cc: linux-kernel, linux-f2fs-devel, yongmyung lee, Jieon Seol,
	Sang-yoon Oh, Mankyu PARK, Sung-Jun Park, Keoseong Park,
	SEUNGUK SHIN, Jinyoung CHOI, Jaemyung Lee

On 2020/11/3 16:38, Daejun Park wrote:
> In the fs-based mode of F2FS, the mapping of hot/warm node to
> WRITE_LIFE_NOT_SET should be changed to WRITE_LIFE_SHORT.
> 
> As a result of analyzing the write pattern of f2fs using real workload,
> hot/warm nodes have high update ratio close to hot data.[*]
> However, F2FS passes write hints for hot/warm nodes as WRITE_LIFE_NOT_SET.
> 
> Furthermore, WRITE_LIFE_NOT_SET is a default value of write hint when it is
> not provided from the file system.
> In storage, write_hint is used to distinguish streams (e.g. NVMe).
> So, the hot/warm node of F2FS is not distinguished from other write_hints,
> which can make the wrong stream seperation.
> 
> * Liang, Yu, et al. "An empirical study of F2FS on mobile devices." 2017
> IEEE 23rd International Conference on Embedded and Real-Time Computing
> Systems and Applications (RTCSA).
> 
> Signed-off-by: Daejun Park <daejun7.park@samsung.com>

Reviewed-by: Chao Yu <yuchao0@huawei.com>

Thanks,

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

* Re: [PATCH v2] f2fs: change write_hint for hot/warm nodes
  2020-11-03  8:38 ` [PATCH v2] f2fs: change write_hint for hot/warm nodes Daejun Park
  2020-11-03  9:01   ` Chao Yu
@ 2020-11-03 18:58   ` Jaegeuk Kim
  2020-11-05  3:15     ` Chao Yu
  1 sibling, 1 reply; 4+ messages in thread
From: Jaegeuk Kim @ 2020-11-03 18:58 UTC (permalink / raw)
  To: Daejun Park
  Cc: chao, linux-kernel, linux-f2fs-devel, Chao Yu, yongmyung lee,
	Jieon Seol, Sang-yoon Oh, Mankyu PARK, Sung-Jun Park,
	Keoseong Park, SEUNGUK SHIN, Jinyoung CHOI, Jaemyung Lee

On 11/03, Daejun Park wrote:
> In the fs-based mode of F2FS, the mapping of hot/warm node to
> WRITE_LIFE_NOT_SET should be changed to WRITE_LIFE_SHORT.
> 
> As a result of analyzing the write pattern of f2fs using real workload,
> hot/warm nodes have high update ratio close to hot data.[*]
> However, F2FS passes write hints for hot/warm nodes as WRITE_LIFE_NOT_SET.

I prefer to keep it as is, since basically node blocks should be separatly
stored from data blocks in different erase blocks in order to match F2FS GC
and FTL GC units. And, we don't do IPU for node blocks which doesn't make sense
to say *update ratio*.

> 
> Furthermore, WRITE_LIFE_NOT_SET is a default value of write hint when it is
> not provided from the file system.
> In storage, write_hint is used to distinguish streams (e.g. NVMe).
> So, the hot/warm node of F2FS is not distinguished from other write_hints,
> which can make the wrong stream seperation.
> 
> * Liang, Yu, et al. "An empirical study of F2FS on mobile devices." 2017
> IEEE 23rd International Conference on Embedded and Real-Time Computing
> Systems and Applications (RTCSA).
> 
> Signed-off-by: Daejun Park <daejun7.park@samsung.com>
> ---
> v2: update documentation and comments
> ---
>  Documentation/filesystems/f2fs.rst | 4 ++--
>  fs/f2fs/segment.c                  | 6 +++---
>  2 files changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/Documentation/filesystems/f2fs.rst b/Documentation/filesystems/f2fs.rst
> index b8ee761c9922..afa3da7cfade 100644
> --- a/Documentation/filesystems/f2fs.rst
> +++ b/Documentation/filesystems/f2fs.rst
> @@ -717,8 +717,8 @@ WRITE_LIFE_LONG       "                        WRITE_LIFE_LONG
>  ===================== ======================== ===================
>  User                  F2FS                     Block
>  ===================== ======================== ===================
> -                      META                     WRITE_LIFE_MEDIUM;
> -                      HOT_NODE                 WRITE_LIFE_NOT_SET
> +                      META                     WRITE_LIFE_MEDIUM
> +                      HOT_NODE                 WRITE_LIFE_SHORT
>                        WARM_NODE                "
>                        COLD_NODE                WRITE_LIFE_NONE
>  ioctl(COLD)           COLD_DATA                WRITE_LIFE_EXTREME
> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
> index 1596502f7375..577ab7516c6b 100644
> --- a/fs/f2fs/segment.c
> +++ b/fs/f2fs/segment.c
> @@ -3160,8 +3160,8 @@ int f2fs_rw_hint_to_seg_type(enum rw_hint hint)
>   *
>   * User                  F2FS                     Block
>   * ----                  ----                     -----
> - *                       META                     WRITE_LIFE_MEDIUM;
> - *                       HOT_NODE                 WRITE_LIFE_NOT_SET
> + *                       META                     WRITE_LIFE_MEDIUM
> + *                       HOT_NODE                 WRITE_LIFE_SHORT
>   *                       WARM_NODE                "
>   *                       COLD_NODE                WRITE_LIFE_NONE
>   * ioctl(COLD)           COLD_DATA                WRITE_LIFE_EXTREME
> @@ -3208,7 +3208,7 @@ enum rw_hint f2fs_io_type_to_rw_hint(struct f2fs_sb_info *sbi,
>  				return WRITE_LIFE_EXTREME;
>  		} else if (type == NODE) {
>  			if (temp == WARM || temp == HOT)
> -				return WRITE_LIFE_NOT_SET;
> +				return WRITE_LIFE_SHORT;
>  			else if (temp == COLD)
>  				return WRITE_LIFE_NONE;
>  		} else if (type == META) {
> -- 
> 2.25.1

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

* Re: [PATCH v2] f2fs: change write_hint for hot/warm nodes
  2020-11-03 18:58   ` Jaegeuk Kim
@ 2020-11-05  3:15     ` Chao Yu
  0 siblings, 0 replies; 4+ messages in thread
From: Chao Yu @ 2020-11-05  3:15 UTC (permalink / raw)
  To: Jaegeuk Kim, Daejun Park
  Cc: chao, linux-kernel, linux-f2fs-devel, yongmyung lee, Jieon Seol,
	Sang-yoon Oh, Mankyu PARK, Sung-Jun Park, Keoseong Park,
	SEUNGUK SHIN, Jinyoung CHOI, Jaemyung Lee

On 2020/11/4 2:58, Jaegeuk Kim wrote:
> On 11/03, Daejun Park wrote:
>> In the fs-based mode of F2FS, the mapping of hot/warm node to
>> WRITE_LIFE_NOT_SET should be changed to WRITE_LIFE_SHORT.
>>
>> As a result of analyzing the write pattern of f2fs using real workload,
>> hot/warm nodes have high update ratio close to hot data.[*]
>> However, F2FS passes write hints for hot/warm nodes as WRITE_LIFE_NOT_SET.
> 
> I prefer to keep it as is, since basically node blocks should be separatly
> stored from data blocks in different erase blocks in order to match F2FS GC

Correct, I missed that the change will break HOT_DATA type and {HOT,WARM}_NODE
type data separation in FTL.

> and FTL GC units. And, we don't do IPU for node blocks which doesn't make sense
> to say *update ratio*.

IMO, if fs discard is fast enough, both IPU and OPU will cause original blkaddr in
FTL being invalid, we can compare update ratio on {I,O}PU IOs inside FTL; otherwise,
we can't.

Thanks,

> 
>>
>> Furthermore, WRITE_LIFE_NOT_SET is a default value of write hint when it is
>> not provided from the file system.
>> In storage, write_hint is used to distinguish streams (e.g. NVMe).
>> So, the hot/warm node of F2FS is not distinguished from other write_hints,
>> which can make the wrong stream seperation.
>>
>> * Liang, Yu, et al. "An empirical study of F2FS on mobile devices." 2017
>> IEEE 23rd International Conference on Embedded and Real-Time Computing
>> Systems and Applications (RTCSA).
>>
>> Signed-off-by: Daejun Park <daejun7.park@samsung.com>
>> ---
>> v2: update documentation and comments
>> ---
>>   Documentation/filesystems/f2fs.rst | 4 ++--
>>   fs/f2fs/segment.c                  | 6 +++---
>>   2 files changed, 5 insertions(+), 5 deletions(-)
>>
>> diff --git a/Documentation/filesystems/f2fs.rst b/Documentation/filesystems/f2fs.rst
>> index b8ee761c9922..afa3da7cfade 100644
>> --- a/Documentation/filesystems/f2fs.rst
>> +++ b/Documentation/filesystems/f2fs.rst
>> @@ -717,8 +717,8 @@ WRITE_LIFE_LONG       "                        WRITE_LIFE_LONG
>>   ===================== ======================== ===================
>>   User                  F2FS                     Block
>>   ===================== ======================== ===================
>> -                      META                     WRITE_LIFE_MEDIUM;
>> -                      HOT_NODE                 WRITE_LIFE_NOT_SET
>> +                      META                     WRITE_LIFE_MEDIUM
>> +                      HOT_NODE                 WRITE_LIFE_SHORT
>>                         WARM_NODE                "
>>                         COLD_NODE                WRITE_LIFE_NONE
>>   ioctl(COLD)           COLD_DATA                WRITE_LIFE_EXTREME
>> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
>> index 1596502f7375..577ab7516c6b 100644
>> --- a/fs/f2fs/segment.c
>> +++ b/fs/f2fs/segment.c
>> @@ -3160,8 +3160,8 @@ int f2fs_rw_hint_to_seg_type(enum rw_hint hint)
>>    *
>>    * User                  F2FS                     Block
>>    * ----                  ----                     -----
>> - *                       META                     WRITE_LIFE_MEDIUM;
>> - *                       HOT_NODE                 WRITE_LIFE_NOT_SET
>> + *                       META                     WRITE_LIFE_MEDIUM
>> + *                       HOT_NODE                 WRITE_LIFE_SHORT
>>    *                       WARM_NODE                "
>>    *                       COLD_NODE                WRITE_LIFE_NONE
>>    * ioctl(COLD)           COLD_DATA                WRITE_LIFE_EXTREME
>> @@ -3208,7 +3208,7 @@ enum rw_hint f2fs_io_type_to_rw_hint(struct f2fs_sb_info *sbi,
>>   				return WRITE_LIFE_EXTREME;
>>   		} else if (type == NODE) {
>>   			if (temp == WARM || temp == HOT)
>> -				return WRITE_LIFE_NOT_SET;
>> +				return WRITE_LIFE_SHORT;
>>   			else if (temp == COLD)
>>   				return WRITE_LIFE_NONE;
>>   		} else if (type == META) {
>> -- 
>> 2.25.1
> .
> 

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

end of thread, other threads:[~2020-11-05  3:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20201103083832epcms2p6c8b0e4470f1392772317ab2b25256b3d@epcms2p6>
2020-11-03  8:38 ` [PATCH v2] f2fs: change write_hint for hot/warm nodes Daejun Park
2020-11-03  9:01   ` Chao Yu
2020-11-03 18:58   ` Jaegeuk Kim
2020-11-05  3:15     ` 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).