Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1586117 > unrolled thread

[PATCH 1/3] f2fs: clean up codes in get_ssr_segment

Started byYunlong Song <yunlong.song@huawei.com>
First post2017-02-22 13:40 +0100
Last post2017-02-23 03:00 +0100
Articles 16 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 1/3] f2fs: clean up codes in get_ssr_segment Yunlong Song <yunlong.song@huawei.com> - 2017-02-22 13:40 +0100
    [PATCH 2/3] f2fs: provide more chance to get node ssr Yunlong Song <yunlong.song@huawei.com> - 2017-02-22 13:40 +0100
    [PATCH 3/3] f2fs: provide more chance for node and data to get ssr segment Yunlong Song <yunlong.song@huawei.com> - 2017-02-22 13:40 +0100
      Re: [PATCH 3/3] f2fs: provide more chance for node and data to get  ssr segment Jaegeuk Kim <jaegeuk@kernel.org> - 2017-02-23 02:20 +0100
        Re: [PATCH 3/3] f2fs: provide more chance for node and data to get  ssr segment Yunlong Song <yunlong.song@huawei.com> - 2017-02-23 03:20 +0100
          Re: [PATCH 3/3] f2fs: provide more chance for node and data to get  ssr segment Yunlong Song <yunlong.song@huawei.com> - 2017-02-23 03:50 +0100
        Re: [PATCH 3/3] f2fs: provide more chance for node and data to get  ssr segment Chao Yu <yuchao0@huawei.com> - 2017-02-24 10:10 +0100
          Re: [PATCH 3/3] f2fs: provide more chance for node and data to get  ssr segment Yunlong Song <yunlong.song@huawei.com> - 2017-02-24 10:30 +0100
            Re: [PATCH 3/3] f2fs: provide more chance for node and data to get  ssr segment Chao Yu <yuchao0@huawei.com> - 2017-02-24 11:50 +0100
              Re: [PATCH 3/3] f2fs: provide more chance for node and data to get  ssr segment Yunlong Song <yunlong.song@huawei.com> - 2017-02-24 12:50 +0100
                Re: [PATCH 3/3] f2fs: provide more chance for node and data to get  ssr segment Jaegeuk Kim <jaegeuk@kernel.org> - 2017-02-24 19:00 +0100
                  Re: [PATCH 3/3] f2fs: provide more chance for node and data to get  ssr segment Jaegeuk Kim <jaegeuk@kernel.org> - 2017-02-24 21:10 +0100
                    Re: [PATCH 3/3] f2fs: provide more chance for node and data to get  ssr segment Yunlong Song <yunlong.song@huawei.com> - 2017-02-25 03:20 +0100
    Re: [PATCH 1/3] f2fs: clean up codes in get_ssr_segment Jaegeuk Kim <jaegeuk@kernel.org> - 2017-02-23 01:50 +0100
      Re: [PATCH 1/3] f2fs: clean up codes in get_ssr_segment Jaegeuk Kim <jaegeuk@kernel.org> - 2017-02-23 02:10 +0100
        Re: [PATCH 1/3] f2fs: clean up codes in get_ssr_segment Yunlong Song <yunlong.song@huawei.com> - 2017-02-23 03:00 +0100

#1586117 — [PATCH 1/3] f2fs: clean up codes in get_ssr_segment

FromYunlong Song <yunlong.song@huawei.com>
Date2017-02-22 13:40 +0100
Subject[PATCH 1/3] f2fs: clean up codes in get_ssr_segment
Message-ID<tdEn8-1FE-25@gated-at.bofh.it>
Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
---
 fs/f2fs/segment.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index df2ff5c..80997f5 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -1541,7 +1541,7 @@ static int get_ssr_segment(struct f2fs_sb_info *sbi, int type)
 	struct curseg_info *curseg = CURSEG_I(sbi, type);
 	const struct victim_selection *v_ops = DIRTY_I(sbi)->v_ops;
 
-	if (IS_NODESEG(type) || !has_not_enough_free_secs(sbi, 0, 0))
+	if (IS_NODESEG(type))
 		return v_ops->get_victim(sbi,
 				&(curseg)->next_segno, BG_GC, type, SSR);
 
-- 
1.8.5.2

[toc] | [next] | [standalone]


#1586118 — [PATCH 2/3] f2fs: provide more chance to get node ssr

FromYunlong Song <yunlong.song@huawei.com>
Date2017-02-22 13:40 +0100
Subject[PATCH 2/3] f2fs: provide more chance to get node ssr
Message-ID<tdEn8-1FE-23@gated-at.bofh.it>
In reply to#1586117
Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
---
 fs/f2fs/segment.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 80997f5..9d13743 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -1541,9 +1541,13 @@ static int get_ssr_segment(struct f2fs_sb_info *sbi, int type)
 	struct curseg_info *curseg = CURSEG_I(sbi, type);
 	const struct victim_selection *v_ops = DIRTY_I(sbi)->v_ops;
 
-	if (IS_NODESEG(type))
-		return v_ops->get_victim(sbi,
-				&(curseg)->next_segno, BG_GC, type, SSR);
+	if (IS_NODESEG(type)) {
+		for (; type >= CURSEG_HOT_NODE; type--)
+			if (v_ops->get_victim(sbi, &(curseg)->next_segno,
+							BG_GC, type, SSR))
+				return 1;
+		return 0;
+	}
 
 	/* For data segments, let's do SSR more intensively */
 	for (; type >= CURSEG_HOT_DATA; type--)
-- 
1.8.5.2

[toc] | [prev] | [next] | [standalone]


#1586119 — [PATCH 3/3] f2fs: provide more chance for node and data to get ssr segment

FromYunlong Song <yunlong.song@huawei.com>
Date2017-02-22 13:40 +0100
Subject[PATCH 3/3] f2fs: provide more chance for node and data to get ssr segment
Message-ID<tdEn8-1FE-27@gated-at.bofh.it>
In reply to#1586117
Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
---
 fs/f2fs/segment.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 9d13743..5fe71b9 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -1540,12 +1540,17 @@ static int get_ssr_segment(struct f2fs_sb_info *sbi, int type)
 {
 	struct curseg_info *curseg = CURSEG_I(sbi, type);
 	const struct victim_selection *v_ops = DIRTY_I(sbi)->v_ops;
+	int old_type = type;
 
 	if (IS_NODESEG(type)) {
 		for (; type >= CURSEG_HOT_NODE; type--)
 			if (v_ops->get_victim(sbi, &(curseg)->next_segno,
 							BG_GC, type, SSR))
 				return 1;
+		for (type = old_type + 1; type <= CURSEG_COLD_NODE; type++)
+			if (v_ops->get_victim(sbi, &(curseg)->next_segno,
+							BG_GC, type, SSR))
+				return 1;
 		return 0;
 	}
 
@@ -1554,6 +1559,10 @@ static int get_ssr_segment(struct f2fs_sb_info *sbi, int type)
 		if (v_ops->get_victim(sbi, &(curseg)->next_segno,
 						BG_GC, type, SSR))
 			return 1;
+	for (type = old_type + 1; type <= CURSEG_COLD_DATA; type++)
+		if (v_ops->get_victim(sbi, &(curseg)->next_segno,
+						BG_GC, type, SSR))
+			return 1;
 	return 0;
 }
 
-- 
1.8.5.2

[toc] | [prev] | [next] | [standalone]


#1586588 — Re: [PATCH 3/3] f2fs: provide more chance for node and data to get ssr segment

FromJaegeuk Kim <jaegeuk@kernel.org>
Date2017-02-23 02:20 +0100
SubjectRe: [PATCH 3/3] f2fs: provide more chance for node and data to get ssr segment
Message-ID<tdQeB-27X-1@gated-at.bofh.it>
In reply to#1586119

[Multipart message — attachments visible in raw view] — view raw

Hi Yunlong,

I've been testing the similar patches as I attached.

Thanks,

On 02/22, Yunlong Song wrote:
> Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
> ---
>  fs/f2fs/segment.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
> index 9d13743..5fe71b9 100644
> --- a/fs/f2fs/segment.c
> +++ b/fs/f2fs/segment.c
> @@ -1540,12 +1540,17 @@ static int get_ssr_segment(struct f2fs_sb_info *sbi, int type)
>  {
>  	struct curseg_info *curseg = CURSEG_I(sbi, type);
>  	const struct victim_selection *v_ops = DIRTY_I(sbi)->v_ops;
> +	int old_type = type;
>  
>  	if (IS_NODESEG(type)) {
>  		for (; type >= CURSEG_HOT_NODE; type--)
>  			if (v_ops->get_victim(sbi, &(curseg)->next_segno,
>  							BG_GC, type, SSR))
>  				return 1;
> +		for (type = old_type + 1; type <= CURSEG_COLD_NODE; type++)
> +			if (v_ops->get_victim(sbi, &(curseg)->next_segno,
> +							BG_GC, type, SSR))
> +				return 1;
>  		return 0;
>  	}
>  
> @@ -1554,6 +1559,10 @@ static int get_ssr_segment(struct f2fs_sb_info *sbi, int type)
>  		if (v_ops->get_victim(sbi, &(curseg)->next_segno,
>  						BG_GC, type, SSR))
>  			return 1;
> +	for (type = old_type + 1; type <= CURSEG_COLD_DATA; type++)
> +		if (v_ops->get_victim(sbi, &(curseg)->next_segno,
> +						BG_GC, type, SSR))
> +			return 1;
>  	return 0;
>  }
>  
> -- 
> 1.8.5.2

[toc] | [prev] | [next] | [standalone]


#1586610 — Re: [PATCH 3/3] f2fs: provide more chance for node and data to get ssr segment

FromYunlong Song <yunlong.song@huawei.com>
Date2017-02-23 03:20 +0100
SubjectRe: [PATCH 3/3] f2fs: provide more chance for node and data to get ssr segment
Message-ID<tdRaF-2LC-5@gated-at.bofh.it>
In reply to#1586588
Hi Jay,
    But there are some differences:
1 Why not take "neighboring temperature" for ssr? For example, if type == CURSEG_COLD_DATA,
    your new patch selects CURSEG_HOT_DATA first, how about select CURSEG_WARM_DATA first?
    The patch I sent ensure this "neighboring temperature" for ssr.
2 Your new patch returns 0 for node ssr, does get_ssr_segment work only for data?
3 I see your new patch just "continue" when i == type, why not consider the current type?

On 2017/2/23 9:17, Jaegeuk Kim wrote:
> Hi Yunlong,
>
> I've been testing the similar patches as I attached.
>
> Thanks,
>
> On 02/22, Yunlong Song wrote:
>> Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
>> ---
>>  fs/f2fs/segment.c | 9 +++++++++
>>  1 file changed, 9 insertions(+)
>>
>> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
>> index 9d13743..5fe71b9 100644
>> --- a/fs/f2fs/segment.c
>> +++ b/fs/f2fs/segment.c
>> @@ -1540,12 +1540,17 @@ static int get_ssr_segment(struct f2fs_sb_info *sbi, int type)
>>  {
>>  	struct curseg_info *curseg = CURSEG_I(sbi, type);
>>  	const struct victim_selection *v_ops = DIRTY_I(sbi)->v_ops;
>> +	int old_type = type;
>>  
>>  	if (IS_NODESEG(type)) {
>>  		for (; type >= CURSEG_HOT_NODE; type--)
>>  			if (v_ops->get_victim(sbi, &(curseg)->next_segno,
>>  							BG_GC, type, SSR))
>>  				return 1;
>> +		for (type = old_type + 1; type <= CURSEG_COLD_NODE; type++)
>> +			if (v_ops->get_victim(sbi, &(curseg)->next_segno,
>> +							BG_GC, type, SSR))
>> +				return 1;
>>  		return 0;
>>  	}
>>  
>> @@ -1554,6 +1559,10 @@ static int get_ssr_segment(struct f2fs_sb_info *sbi, int type)
>>  		if (v_ops->get_victim(sbi, &(curseg)->next_segno,
>>  						BG_GC, type, SSR))
>>  			return 1;
>> +	for (type = old_type + 1; type <= CURSEG_COLD_DATA; type++)
>> +		if (v_ops->get_victim(sbi, &(curseg)->next_segno,
>> +						BG_GC, type, SSR))
>> +			return 1;
>>  	return 0;
>>  }
>>  
>> -- 
>> 1.8.5.2


-- 
Thanks,
Yunlong Song

[toc] | [prev] | [next] | [standalone]


#1586617 — Re: [PATCH 3/3] f2fs: provide more chance for node and data to get ssr segment

FromYunlong Song <yunlong.song@huawei.com>
Date2017-02-23 03:50 +0100
SubjectRe: [PATCH 3/3] f2fs: provide more chance for node and data to get ssr segment
Message-ID<tdRDI-2Xg-5@gated-at.bofh.it>
In reply to#1586610
Hi Jay,
    I miss some codes from your mail, now I check all your patch codes and make clear with question 2 and 3, it's fine.

    But still, how about question 1?

On 2017/2/23 10:13, Yunlong Song wrote:
> Hi Jay,
>     But there are some differences:
> 1 Why not take "neighboring temperature" for ssr? For example, if type == CURSEG_COLD_DATA,
>     your new patch selects CURSEG_HOT_DATA first, how about select CURSEG_WARM_DATA first?
>     The patch I sent ensure this "neighboring temperature" for ssr.
> 2 Your new patch returns 0 for node ssr, does get_ssr_segment work only for data?
> 3 I see your new patch just "continue" when i == type, why not consider the current type?
>
> On 2017/2/23 9:17, Jaegeuk Kim wrote:
>> Hi Yunlong,
>>
>> I've been testing the similar patches as I attached.
>>
>> Thanks,
>>
>> On 02/22, Yunlong Song wrote:
>>> Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
>>> ---
>>>  fs/f2fs/segment.c | 9 +++++++++
>>>  1 file changed, 9 insertions(+)
>>>
>>> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
>>> index 9d13743..5fe71b9 100644
>>> --- a/fs/f2fs/segment.c
>>> +++ b/fs/f2fs/segment.c
>>> @@ -1540,12 +1540,17 @@ static int get_ssr_segment(struct f2fs_sb_info *sbi, int type)
>>>  {
>>>  	struct curseg_info *curseg = CURSEG_I(sbi, type);
>>>  	const struct victim_selection *v_ops = DIRTY_I(sbi)->v_ops;
>>> +	int old_type = type;
>>>  
>>>  	if (IS_NODESEG(type)) {
>>>  		for (; type >= CURSEG_HOT_NODE; type--)
>>>  			if (v_ops->get_victim(sbi, &(curseg)->next_segno,
>>>  							BG_GC, type, SSR))
>>>  				return 1;
>>> +		for (type = old_type + 1; type <= CURSEG_COLD_NODE; type++)
>>> +			if (v_ops->get_victim(sbi, &(curseg)->next_segno,
>>> +							BG_GC, type, SSR))
>>> +				return 1;
>>>  		return 0;
>>>  	}
>>>  
>>> @@ -1554,6 +1559,10 @@ static int get_ssr_segment(struct f2fs_sb_info *sbi, int type)
>>>  		if (v_ops->get_victim(sbi, &(curseg)->next_segno,
>>>  						BG_GC, type, SSR))
>>>  			return 1;
>>> +	for (type = old_type + 1; type <= CURSEG_COLD_DATA; type++)
>>> +		if (v_ops->get_victim(sbi, &(curseg)->next_segno,
>>> +						BG_GC, type, SSR))
>>> +			return 1;
>>>  	return 0;
>>>  }
>>>  
>>> -- 
>>> 1.8.5.2
>


-- 
Thanks,
Yunlong Song

[toc] | [prev] | [next] | [standalone]


#1587432 — Re: [PATCH 3/3] f2fs: provide more chance for node and data to get ssr segment

FromChao Yu <yuchao0@huawei.com>
Date2017-02-24 10:10 +0100
SubjectRe: [PATCH 3/3] f2fs: provide more chance for node and data to get ssr segment
Message-ID<tek2Z-6t4-1@gated-at.bofh.it>
In reply to#1586588
Hi Jaegeuk,

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

For your attached two patches.

Thanks,

On 2017/2/23 9:17, Jaegeuk Kim wrote:
> Hi Yunlong,
> 
> I've been testing the similar patches as I attached.
> 
> Thanks,
> 
> On 02/22, Yunlong Song wrote:
>> Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
>> ---
>>  fs/f2fs/segment.c | 9 +++++++++
>>  1 file changed, 9 insertions(+)
>>
>> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
>> index 9d13743..5fe71b9 100644
>> --- a/fs/f2fs/segment.c
>> +++ b/fs/f2fs/segment.c
>> @@ -1540,12 +1540,17 @@ static int get_ssr_segment(struct f2fs_sb_info *sbi, int type)
>>  {
>>  	struct curseg_info *curseg = CURSEG_I(sbi, type);
>>  	const struct victim_selection *v_ops = DIRTY_I(sbi)->v_ops;
>> +	int old_type = type;
>>  
>>  	if (IS_NODESEG(type)) {
>>  		for (; type >= CURSEG_HOT_NODE; type--)
>>  			if (v_ops->get_victim(sbi, &(curseg)->next_segno,
>>  							BG_GC, type, SSR))
>>  				return 1;
>> +		for (type = old_type + 1; type <= CURSEG_COLD_NODE; type++)
>> +			if (v_ops->get_victim(sbi, &(curseg)->next_segno,
>> +							BG_GC, type, SSR))
>> +				return 1;
>>  		return 0;
>>  	}
>>  
>> @@ -1554,6 +1559,10 @@ static int get_ssr_segment(struct f2fs_sb_info *sbi, int type)
>>  		if (v_ops->get_victim(sbi, &(curseg)->next_segno,
>>  						BG_GC, type, SSR))
>>  			return 1;
>> +	for (type = old_type + 1; type <= CURSEG_COLD_DATA; type++)
>> +		if (v_ops->get_victim(sbi, &(curseg)->next_segno,
>> +						BG_GC, type, SSR))
>> +			return 1;
>>  	return 0;
>>  }
>>  
>> -- 
>> 1.8.5.2

[toc] | [prev] | [next] | [standalone]


#1587455 — Re: [PATCH 3/3] f2fs: provide more chance for node and data to get ssr segment

FromYunlong Song <yunlong.song@huawei.com>
Date2017-02-24 10:30 +0100
SubjectRe: [PATCH 3/3] f2fs: provide more chance for node and data to get ssr segment
Message-ID<tekmm-6zZ-5@gated-at.bofh.it>
In reply to#1587432
Hi Jaegeuk and Chao,

    How about the question I pointed out in last mail:
    Why not take "neighboring temperature" for ssr? For example, if type == CURSEG_COLD_DATA,
    the new patch selects CURSEG_HOT_DATA first, why not select CURSEG_WARM_DATA first?
    The patch I sent ensure this "neighboring temperature" for ssr. This is to reduce the influence of
    mixing different levels of hot/code node types.

On 2017/2/24 17:05, Chao Yu wrote:
> Hi Jaegeuk,
>
> Reviewed-by: Chao Yu <yuchao0@huawei.com>
>
> For your attached two patches.
>
> Thanks,
>
> On 2017/2/23 9:17, Jaegeuk Kim wrote:
>> Hi Yunlong,
>>
>> I've been testing the similar patches as I attached.
>>
>> Thanks,
>>
>> On 02/22, Yunlong Song wrote:
>>> Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
>>> ---
>>>  fs/f2fs/segment.c | 9 +++++++++
>>>  1 file changed, 9 insertions(+)
>>>
>>> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
>>> index 9d13743..5fe71b9 100644
>>> --- a/fs/f2fs/segment.c
>>> +++ b/fs/f2fs/segment.c
>>> @@ -1540,12 +1540,17 @@ static int get_ssr_segment(struct f2fs_sb_info *sbi, int type)
>>>  {
>>>  	struct curseg_info *curseg = CURSEG_I(sbi, type);
>>>  	const struct victim_selection *v_ops = DIRTY_I(sbi)->v_ops;
>>> +	int old_type = type;
>>>  
>>>  	if (IS_NODESEG(type)) {
>>>  		for (; type >= CURSEG_HOT_NODE; type--)
>>>  			if (v_ops->get_victim(sbi, &(curseg)->next_segno,
>>>  							BG_GC, type, SSR))
>>>  				return 1;
>>> +		for (type = old_type + 1; type <= CURSEG_COLD_NODE; type++)
>>> +			if (v_ops->get_victim(sbi, &(curseg)->next_segno,
>>> +							BG_GC, type, SSR))
>>> +				return 1;
>>>  		return 0;
>>>  	}
>>>  
>>> @@ -1554,6 +1559,10 @@ static int get_ssr_segment(struct f2fs_sb_info *sbi, int type)
>>>  		if (v_ops->get_victim(sbi, &(curseg)->next_segno,
>>>  						BG_GC, type, SSR))
>>>  			return 1;
>>> +	for (type = old_type + 1; type <= CURSEG_COLD_DATA; type++)
>>> +		if (v_ops->get_victim(sbi, &(curseg)->next_segno,
>>> +						BG_GC, type, SSR))
>>> +			return 1;
>>>  	return 0;
>>>  }
>>>  
>>> -- 
>>> 1.8.5.2
>
> .
>


-- 
Thanks,
Yunlong Song

[toc] | [prev] | [next] | [standalone]


#1587513 — Re: [PATCH 3/3] f2fs: provide more chance for node and data to get ssr segment

FromChao Yu <yuchao0@huawei.com>
Date2017-02-24 11:50 +0100
SubjectRe: [PATCH 3/3] f2fs: provide more chance for node and data to get ssr segment
Message-ID<telBM-7lx-1@gated-at.bofh.it>
In reply to#1587455
On 2017/2/24 17:19, Yunlong Song wrote:
> Hi Jaegeuk and Chao,
> 
>     How about the question I pointed out in last mail:
>     Why not take "neighboring temperature" for ssr? For example, if type == CURSEG_COLD_DATA,
>     the new patch selects CURSEG_HOT_DATA first, why not select CURSEG_WARM_DATA first?
>     The patch I sent ensure this "neighboring temperature" for ssr. This is to reduce the influence of
>     mixing different levels of hot/code node types.

Agreed, I sent one patch for changing the policy of SSR, how do you think of it?

Thanks,

> 
> On 2017/2/24 17:05, Chao Yu wrote:
>> Hi Jaegeuk,
>>
>> Reviewed-by: Chao Yu <yuchao0@huawei.com>
>>
>> For your attached two patches.
>>
>> Thanks,
>>
>> On 2017/2/23 9:17, Jaegeuk Kim wrote:
>>> Hi Yunlong,
>>>
>>> I've been testing the similar patches as I attached.
>>>
>>> Thanks,
>>>
>>> On 02/22, Yunlong Song wrote:
>>>> Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
>>>> ---
>>>>  fs/f2fs/segment.c | 9 +++++++++
>>>>  1 file changed, 9 insertions(+)
>>>>
>>>> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
>>>> index 9d13743..5fe71b9 100644
>>>> --- a/fs/f2fs/segment.c
>>>> +++ b/fs/f2fs/segment.c
>>>> @@ -1540,12 +1540,17 @@ static int get_ssr_segment(struct f2fs_sb_info *sbi, int type)
>>>>  {
>>>>  	struct curseg_info *curseg = CURSEG_I(sbi, type);
>>>>  	const struct victim_selection *v_ops = DIRTY_I(sbi)->v_ops;
>>>> +	int old_type = type;
>>>>  
>>>>  	if (IS_NODESEG(type)) {
>>>>  		for (; type >= CURSEG_HOT_NODE; type--)
>>>>  			if (v_ops->get_victim(sbi, &(curseg)->next_segno,
>>>>  							BG_GC, type, SSR))
>>>>  				return 1;
>>>> +		for (type = old_type + 1; type <= CURSEG_COLD_NODE; type++)
>>>> +			if (v_ops->get_victim(sbi, &(curseg)->next_segno,
>>>> +							BG_GC, type, SSR))
>>>> +				return 1;
>>>>  		return 0;
>>>>  	}
>>>>  
>>>> @@ -1554,6 +1559,10 @@ static int get_ssr_segment(struct f2fs_sb_info *sbi, int type)
>>>>  		if (v_ops->get_victim(sbi, &(curseg)->next_segno,
>>>>  						BG_GC, type, SSR))
>>>>  			return 1;
>>>> +	for (type = old_type + 1; type <= CURSEG_COLD_DATA; type++)
>>>> +		if (v_ops->get_victim(sbi, &(curseg)->next_segno,
>>>> +						BG_GC, type, SSR))
>>>> +			return 1;
>>>>  	return 0;
>>>>  }
>>>>  
>>>> -- 
>>>> 1.8.5.2
>>
>> .
>>
> 
> 

[toc] | [prev] | [next] | [standalone]


#1587540 — Re: [PATCH 3/3] f2fs: provide more chance for node and data to get ssr segment

FromYunlong Song <yunlong.song@huawei.com>
Date2017-02-24 12:50 +0100
SubjectRe: [PATCH 3/3] f2fs: provide more chance for node and data to get ssr segment
Message-ID<temxR-7YF-31@gated-at.bofh.it>
In reply to#1587513
Hi, Chao,

Not looks good to me, since there is some case your code does not include:
if type is CURSEG_HOT_DATA, and if get_victim also returns 0 for both CURSEG_HOT_DATA and
CURSEG_WARM_DATA, then i will be -1 and pass to get_victim in your code.  So I still suggest
my original patch attached below.

On 2017/2/24 18:47, Chao Yu wrote:
> On 2017/2/24 17:19, Yunlong Song wrote:
>> Hi Jaegeuk and Chao,
>>
>>     How about the question I pointed out in last mail:
>>     Why not take "neighboring temperature" for ssr? For example, if type == CURSEG_COLD_DATA,
>>     the new patch selects CURSEG_HOT_DATA first, why not select CURSEG_WARM_DATA first?
>>     The patch I sent ensure this "neighboring temperature" for ssr. This is to reduce the influence of
>>     mixing different levels of hot/code node types.
> Agreed, I sent one patch for changing the policy of SSR, how do you think of it?
>
> Thanks,
>
>> On 2017/2/24 17:05, Chao Yu wrote:
>>> Hi Jaegeuk,
>>>
>>> Reviewed-by: Chao Yu <yuchao0@huawei.com>
>>>
>>> For your attached two patches.
>>>
>>> Thanks,
>>>
>>> On 2017/2/23 9:17, Jaegeuk Kim wrote:
>>>> Hi Yunlong,
>>>>
>>>> I've been testing the similar patches as I attached.
>>>>
>>>> Thanks,
>>>>
>>>> On 02/22, Yunlong Song wrote:
>>>>> Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
>>>>> ---
>>>>>  fs/f2fs/segment.c | 9 +++++++++
>>>>>  1 file changed, 9 insertions(+)
>>>>>
>>>>> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
>>>>> index 9d13743..5fe71b9 100644
>>>>> --- a/fs/f2fs/segment.c
>>>>> +++ b/fs/f2fs/segment.c
>>>>> @@ -1540,12 +1540,17 @@ static int get_ssr_segment(struct f2fs_sb_info *sbi, int type)
>>>>>  {
>>>>>  	struct curseg_info *curseg = CURSEG_I(sbi, type);
>>>>>  	const struct victim_selection *v_ops = DIRTY_I(sbi)->v_ops;
>>>>> +	int old_type = type;
>>>>>  
>>>>>  	if (IS_NODESEG(type)) {
>>>>>  		for (; type >= CURSEG_HOT_NODE; type--)
>>>>>  			if (v_ops->get_victim(sbi, &(curseg)->next_segno,
>>>>>  							BG_GC, type, SSR))
>>>>>  				return 1;
>>>>> +		for (type = old_type + 1; type <= CURSEG_COLD_NODE; type++)
>>>>> +			if (v_ops->get_victim(sbi, &(curseg)->next_segno,
>>>>> +							BG_GC, type, SSR))
>>>>> +				return 1;
>>>>>  		return 0;
>>>>>  	}
>>>>>  
>>>>> @@ -1554,6 +1559,10 @@ static int get_ssr_segment(struct f2fs_sb_info *sbi, int type)
>>>>>  		if (v_ops->get_victim(sbi, &(curseg)->next_segno,
>>>>>  						BG_GC, type, SSR))
>>>>>  			return 1;
>>>>> +	for (type = old_type + 1; type <= CURSEG_COLD_DATA; type++)
>>>>> +		if (v_ops->get_victim(sbi, &(curseg)->next_segno,
>>>>> +						BG_GC, type, SSR))
>>>>> +			return 1;
>>>>>  	return 0;
>>>>>  }
>>>>>  
>>>>> -- 
>>>>> 1.8.5.2
>>> .
>>>
>>
>
> .
>


-- 
Thanks,
Yunlong Song

[toc] | [prev] | [next] | [standalone]


#1587839 — Re: [PATCH 3/3] f2fs: provide more chance for node and data to get ssr segment

FromJaegeuk Kim <jaegeuk@kernel.org>
Date2017-02-24 19:00 +0100
SubjectRe: [PATCH 3/3] f2fs: provide more chance for node and data to get ssr segment
Message-ID<tesjT-3yY-9@gated-at.bofh.it>
In reply to#1587540
On 02/24, Yunlong Song wrote:
> Hi, Chao,
> 
> Not looks good to me, since there is some case your code does not include:
> if type is CURSEG_HOT_DATA, and if get_victim also returns 0 for both CURSEG_HOT_DATA and
> CURSEG_WARM_DATA, then i will be -1 and pass to get_victim in your code.  So I still suggest
> my original patch attached below.

Why does i become -1?

> 
> On 2017/2/24 18:47, Chao Yu wrote:
> > On 2017/2/24 17:19, Yunlong Song wrote:
> >> Hi Jaegeuk and Chao,
> >>
> >>     How about the question I pointed out in last mail:
> >>     Why not take "neighboring temperature" for ssr? For example, if type == CURSEG_COLD_DATA,
> >>     the new patch selects CURSEG_HOT_DATA first, why not select CURSEG_WARM_DATA first?
> >>     The patch I sent ensure this "neighboring temperature" for ssr. This is to reduce the influence of
> >>     mixing different levels of hot/code node types.
> > Agreed, I sent one patch for changing the policy of SSR, how do you think of it?
> >
> > Thanks,
> >
> >> On 2017/2/24 17:05, Chao Yu wrote:
> >>> Hi Jaegeuk,
> >>>
> >>> Reviewed-by: Chao Yu <yuchao0@huawei.com>
> >>>
> >>> For your attached two patches.
> >>>
> >>> Thanks,
> >>>
> >>> On 2017/2/23 9:17, Jaegeuk Kim wrote:
> >>>> Hi Yunlong,
> >>>>
> >>>> I've been testing the similar patches as I attached.
> >>>>
> >>>> Thanks,
> >>>>
> >>>> On 02/22, Yunlong Song wrote:
> >>>>> Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
> >>>>> ---
> >>>>>  fs/f2fs/segment.c | 9 +++++++++
> >>>>>  1 file changed, 9 insertions(+)
> >>>>>
> >>>>> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
> >>>>> index 9d13743..5fe71b9 100644
> >>>>> --- a/fs/f2fs/segment.c
> >>>>> +++ b/fs/f2fs/segment.c
> >>>>> @@ -1540,12 +1540,17 @@ static int get_ssr_segment(struct f2fs_sb_info *sbi, int type)
> >>>>>  {
> >>>>>  	struct curseg_info *curseg = CURSEG_I(sbi, type);
> >>>>>  	const struct victim_selection *v_ops = DIRTY_I(sbi)->v_ops;
> >>>>> +	int old_type = type;
> >>>>>  
> >>>>>  	if (IS_NODESEG(type)) {
> >>>>>  		for (; type >= CURSEG_HOT_NODE; type--)
> >>>>>  			if (v_ops->get_victim(sbi, &(curseg)->next_segno,
> >>>>>  							BG_GC, type, SSR))
> >>>>>  				return 1;
> >>>>> +		for (type = old_type + 1; type <= CURSEG_COLD_NODE; type++)
> >>>>> +			if (v_ops->get_victim(sbi, &(curseg)->next_segno,
> >>>>> +							BG_GC, type, SSR))
> >>>>> +				return 1;
> >>>>>  		return 0;
> >>>>>  	}
> >>>>>  
> >>>>> @@ -1554,6 +1559,10 @@ static int get_ssr_segment(struct f2fs_sb_info *sbi, int type)
> >>>>>  		if (v_ops->get_victim(sbi, &(curseg)->next_segno,
> >>>>>  						BG_GC, type, SSR))
> >>>>>  			return 1;
> >>>>> +	for (type = old_type + 1; type <= CURSEG_COLD_DATA; type++)
> >>>>> +		if (v_ops->get_victim(sbi, &(curseg)->next_segno,
> >>>>> +						BG_GC, type, SSR))
> >>>>> +			return 1;
> >>>>>  	return 0;
> >>>>>  }
> >>>>>  
> >>>>> -- 
> >>>>> 1.8.5.2
> >>> .
> >>>
> >>
> >
> > .
> >
> 
> 
> -- 
> Thanks,
> Yunlong Song
> 

[toc] | [prev] | [next] | [standalone]


#1587910 — Re: [PATCH 3/3] f2fs: provide more chance for node and data to get ssr segment

FromJaegeuk Kim <jaegeuk@kernel.org>
Date2017-02-24 21:10 +0100
SubjectRe: [PATCH 3/3] f2fs: provide more chance for node and data to get ssr segment
Message-ID<teulH-5iW-3@gated-at.bofh.it>
In reply to#1587839
On 02/25, Yunlong Song wrote:
> Hi,Jaegeuk and Chao,
>     Sorry,I misunderstood CURSEG_HOT_DATA is greater than CURSEG_WARM_DATA and use "i--" in the codes, so just forget that.
>     But there is still a issue, when type is CURSEG_WARM_DATA, chao's patch will select cold SSR segment first, but my patch will select hot SSR segment first, since I think the probability of having hot SSR segment is bigger than having cold SSR segment due to the temperature itself.

One thing that I'm seeing is, theoretically hot segments will get dirty more
frequently. So if we select dirty cold segments for warm data, we can gain
fully valid cold segments more, which can mitigate log thrashing problem.

Thanks,

> 
> 
> On 02/25/2017 01:58, Jaegeuk Kim wrote:
> On 02/24, Yunlong Song wrote:
> > Hi, Chao,
> >
> > Not looks good to me, since there is some case your code does not include:
> > if type is CURSEG_HOT_DATA, and if get_victim also returns 0 for both CURSEG_HOT_DATA and
> > CURSEG_WARM_DATA, then i will be -1 and pass to get_victim in your code.  So I still suggest
> > my original patch attached below.
> 
> Why does i become -1?
> 
> >
> > On 2017/2/24 18:47, Chao Yu wrote:
> > > On 2017/2/24 17:19, Yunlong Song wrote:
> > >> Hi Jaegeuk and Chao,
> > >>
> > >>     How about the question I pointed out in last mail:
> > >>     Why not take "neighboring temperature" for ssr? For example, if type == CURSEG_COLD_DATA,
> > >>     the new patch selects CURSEG_HOT_DATA first, why not select CURSEG_WARM_DATA first?
> > >>     The patch I sent ensure this "neighboring temperature" for ssr. This is to reduce the influence of
> > >>     mixing different levels of hot/code node types.
> > > Agreed, I sent one patch for changing the policy of SSR, how do you think of it?
> > >
> > > Thanks,
> > >
> > >> On 2017/2/24 17:05, Chao Yu wrote:
> > >>> Hi Jaegeuk,
> > >>>
> > >>> Reviewed-by: Chao Yu <yuchao0@huawei.com>
> > >>>
> > >>> For your attached two patches.
> > >>>
> > >>> Thanks,
> > >>>
> > >>> On 2017/2/23 9:17, Jaegeuk Kim wrote:
> > >>>> Hi Yunlong,
> > >>>>
> > >>>> I've been testing the similar patches as I attached.
> > >>>>
> > >>>> Thanks,
> > >>>>
> > >>>> On 02/22, Yunlong Song wrote:
> > >>>>> Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
> > >>>>> ---
> > >>>>>  fs/f2fs/segment.c | 9 +++++++++
> > >>>>>  1 file changed, 9 insertions(+)
> > >>>>>
> > >>>>> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
> > >>>>> index 9d13743..5fe71b9 100644
> > >>>>> --- a/fs/f2fs/segment.c
> > >>>>> +++ b/fs/f2fs/segment.c
> > >>>>> @@ -1540,12 +1540,17 @@ static int get_ssr_segment(struct f2fs_sb_info *sbi, int type)
> > >>>>>  {
> > >>>>>      struct curseg_info *curseg = CURSEG_I(sbi, type);
> > >>>>>      const struct victim_selection *v_ops = DIRTY_I(sbi)->v_ops;
> > >>>>> +    int old_type = type;
> > >>>>>  
> > >>>>>      if (IS_NODESEG(type)) {
> > >>>>>          for (; type >= CURSEG_HOT_NODE; type--)
> > >>>>>              if (v_ops->get_victim(sbi, &(curseg)->next_segno,
> > >>>>>                              BG_GC, type, SSR))
> > >>>>>                  return 1;
> > >>>>> +        for (type = old_type + 1; type <= CURSEG_COLD_NODE; type++)
> > >>>>> +            if (v_ops->get_victim(sbi, &(curseg)->next_segno,
> > >>>>> +                            BG_GC, type, SSR))
> > >>>>> +                return 1;
> > >>>>>          return 0;
> > >>>>>      }
> > >>>>>  
> > >>>>> @@ -1554,6 +1559,10 @@ static int get_ssr_segment(struct f2fs_sb_info *sbi, int type)
> > >>>>>          if (v_ops->get_victim(sbi, &(curseg)->next_segno,
> > >>>>>                          BG_GC, type, SSR))
> > >>>>>              return 1;
> > >>>>> +    for (type = old_type + 1; type <= CURSEG_COLD_DATA; type++)
> > >>>>> +        if (v_ops->get_victim(sbi, &(curseg)->next_segno,
> > >>>>> +                        BG_GC, type, SSR))
> > >>>>> +            return 1;
> > >>>>>      return 0;
> > >>>>>  }
> > >>>>>  
> > >>>>> --
> > >>>>> 1.8.5.2
> > >>> .
> > >>>
> > >>
> > >
> > > .
> > >
> >
> >
> > --
> > Thanks,
> > Yunlong Song
> >

[toc] | [prev] | [next] | [standalone]


#1588041 — Re: [PATCH 3/3] f2fs: provide more chance for node and data to get ssr segment

FromYunlong Song <yunlong.song@huawei.com>
Date2017-02-25 03:20 +0100
SubjectRe: [PATCH 3/3] f2fs: provide more chance for node and data to get ssr segment
Message-ID<teA7L-Sl-3@gated-at.bofh.it>
In reply to#1587910
The get_ssr_segment happens when need_SSR is true, that is to say we must make sure we can
achieve a right available SSR segment at least, so why not select the type with larger probability?
And I think warm and hot are more similar with each other, maybe the update frequency is difference,
but if time goes by, warm segments will finally update their blocks like hot segments, but cold segments
are something like which should and will never update, so I prefer to put hot and warm to one side,
and put cold to the other side.

On 2017/2/25 4:05, Jaegeuk Kim wrote:
> On 02/25, Yunlong Song wrote:
>> Hi,Jaegeuk and Chao,
>>     Sorry,I misunderstood CURSEG_HOT_DATA is greater than CURSEG_WARM_DATA and use "i--" in the codes, so just forget that.
>>     But there is still a issue, when type is CURSEG_WARM_DATA, chao's patch will select cold SSR segment first, but my patch will select hot SSR segment first, since I think the probability of having hot SSR segment is bigger than having cold SSR segment due to the temperature itself.
> One thing that I'm seeing is, theoretically hot segments will get dirty more
> frequently. So if we select dirty cold segments for warm data, we can gain
> fully valid cold segments more, which can mitigate log thrashing problem.
>
> Thanks,
>
>>
>> On 02/25/2017 01:58, Jaegeuk Kim wrote:
>> On 02/24, Yunlong Song wrote:
>>> Hi, Chao,
>>>
>>> Not looks good to me, since there is some case your code does not include:
>>> if type is CURSEG_HOT_DATA, and if get_victim also returns 0 for both CURSEG_HOT_DATA and
>>> CURSEG_WARM_DATA, then i will be -1 and pass to get_victim in your code.  So I still suggest
>>> my original patch attached below.
>> Why does i become -1?
>>
>>> On 2017/2/24 18:47, Chao Yu wrote:
>>>> On 2017/2/24 17:19, Yunlong Song wrote:
>>>>> Hi Jaegeuk and Chao,
>>>>>
>>>>>     How about the question I pointed out in last mail:
>>>>>     Why not take "neighboring temperature" for ssr? For example, if type == CURSEG_COLD_DATA,
>>>>>     the new patch selects CURSEG_HOT_DATA first, why not select CURSEG_WARM_DATA first?
>>>>>     The patch I sent ensure this "neighboring temperature" for ssr. This is to reduce the influence of
>>>>>     mixing different levels of hot/code node types.
>>>> Agreed, I sent one patch for changing the policy of SSR, how do you think of it?
>>>>
>>>> Thanks,
>>>>
>>>>> On 2017/2/24 17:05, Chao Yu wrote:
>>>>>> Hi Jaegeuk,
>>>>>>
>>>>>> Reviewed-by: Chao Yu <yuchao0@huawei.com>
>>>>>>
>>>>>> For your attached two patches.
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> On 2017/2/23 9:17, Jaegeuk Kim wrote:
>>>>>>> Hi Yunlong,
>>>>>>>
>>>>>>> I've been testing the similar patches as I attached.
>>>>>>>
>>>>>>> Thanks,
>>>>>>>
>>>>>>> On 02/22, Yunlong Song wrote:
>>>>>>>> Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
>>>>>>>> ---
>>>>>>>>  fs/f2fs/segment.c | 9 +++++++++
>>>>>>>>  1 file changed, 9 insertions(+)
>>>>>>>>
>>>>>>>> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
>>>>>>>> index 9d13743..5fe71b9 100644
>>>>>>>> --- a/fs/f2fs/segment.c
>>>>>>>> +++ b/fs/f2fs/segment.c
>>>>>>>> @@ -1540,12 +1540,17 @@ static int get_ssr_segment(struct f2fs_sb_info *sbi, int type)
>>>>>>>>  {
>>>>>>>>      struct curseg_info *curseg = CURSEG_I(sbi, type);
>>>>>>>>      const struct victim_selection *v_ops = DIRTY_I(sbi)->v_ops;
>>>>>>>> +    int old_type = type;
>>>>>>>>  
>>>>>>>>      if (IS_NODESEG(type)) {
>>>>>>>>          for (; type >= CURSEG_HOT_NODE; type--)
>>>>>>>>              if (v_ops->get_victim(sbi, &(curseg)->next_segno,
>>>>>>>>                              BG_GC, type, SSR))
>>>>>>>>                  return 1;
>>>>>>>> +        for (type = old_type + 1; type <= CURSEG_COLD_NODE; type++)
>>>>>>>> +            if (v_ops->get_victim(sbi, &(curseg)->next_segno,
>>>>>>>> +                            BG_GC, type, SSR))
>>>>>>>> +                return 1;
>>>>>>>>          return 0;
>>>>>>>>      }
>>>>>>>>  
>>>>>>>> @@ -1554,6 +1559,10 @@ static int get_ssr_segment(struct f2fs_sb_info *sbi, int type)
>>>>>>>>          if (v_ops->get_victim(sbi, &(curseg)->next_segno,
>>>>>>>>                          BG_GC, type, SSR))
>>>>>>>>              return 1;
>>>>>>>> +    for (type = old_type + 1; type <= CURSEG_COLD_DATA; type++)
>>>>>>>> +        if (v_ops->get_victim(sbi, &(curseg)->next_segno,
>>>>>>>> +                        BG_GC, type, SSR))
>>>>>>>> +            return 1;
>>>>>>>>      return 0;
>>>>>>>>  }
>>>>>>>>  
>>>>>>>> --
>>>>>>>> 1.8.5.2
>>>>>> .
>>>>>>
>>>> .
>>>>
>>>
>>> --
>>> Thanks,
>>> Yunlong Song
>>>
> .
>


-- 
Thanks,
Yunlong Song

[toc] | [prev] | [next] | [standalone]


#1586580

FromJaegeuk Kim <jaegeuk@kernel.org>
Date2017-02-23 01:50 +0100
Message-ID<tdPLA-1Fm-5@gated-at.bofh.it>
In reply to#1586117
Hi Yunlong,

This is NOT clean-up. What's your point here?

Thanks,

On 02/22, Yunlong Song wrote:
> Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
> ---
>  fs/f2fs/segment.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
> index df2ff5c..80997f5 100644
> --- a/fs/f2fs/segment.c
> +++ b/fs/f2fs/segment.c
> @@ -1541,7 +1541,7 @@ static int get_ssr_segment(struct f2fs_sb_info *sbi, int type)
>  	struct curseg_info *curseg = CURSEG_I(sbi, type);
>  	const struct victim_selection *v_ops = DIRTY_I(sbi)->v_ops;
>  
> -	if (IS_NODESEG(type) || !has_not_enough_free_secs(sbi, 0, 0))
> +	if (IS_NODESEG(type))
>  		return v_ops->get_victim(sbi,
>  				&(curseg)->next_segno, BG_GC, type, SSR);
>  
> -- 
> 1.8.5.2

[toc] | [prev] | [next] | [standalone]


#1586586

FromJaegeuk Kim <jaegeuk@kernel.org>
Date2017-02-23 02:10 +0100
Message-ID<tdQ4V-23X-1@gated-at.bofh.it>
In reply to#1586580
On 02/22, Jaegeuk Kim wrote:
> Hi Yunlong,
> 
> This is NOT clean-up. What's your point here?

I guess you wanted to do like this.

From 8d344ac45890dd95c5734fd29a19a7c19364c327 Mon Sep 17 00:00:00 2001
From: Yunlong Song <yunlong.song@huawei.com>
Date: Wed, 22 Feb 2017 20:50:49 +0800
Subject: [PATCH] f2fs: do SSR for data when there is enough free space

In allocate_segment_by_default(), need_SSR() already detected it's time to do
SSR. So, let's try to find victims for data segments more aggressively in time.

Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 fs/f2fs/segment.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index d01ee7b94702..c27dab43c42f 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -1541,7 +1541,7 @@ static int get_ssr_segment(struct f2fs_sb_info *sbi, int type)
 	struct curseg_info *curseg = CURSEG_I(sbi, type);
 	const struct victim_selection *v_ops = DIRTY_I(sbi)->v_ops;
 
-	if (IS_NODESEG(type) || !has_not_enough_free_secs(sbi, 0, 0))
+	if (IS_NODESEG(type))
 		return v_ops->get_victim(sbi,
 				&(curseg)->next_segno, BG_GC, type, SSR);
 
-- 
2.11.0

[toc] | [prev] | [next] | [standalone]


#1586605

FromYunlong Song <yunlong.song@huawei.com>
Date2017-02-23 03:00 +0100
Message-ID<tdQRj-2pn-1@gated-at.bofh.it>
In reply to#1586586
Yes, exactly, I just mean it for short with word "clean up", thanks for correction.

On 2017/2/23 8:59, Jaegeuk Kim wrote:
> On 02/22, Jaegeuk Kim wrote:
>> Hi Yunlong,
>>
>> This is NOT clean-up. What's your point here?
> I guess you wanted to do like this.
>
> >From 8d344ac45890dd95c5734fd29a19a7c19364c327 Mon Sep 17 00:00:00 2001
> From: Yunlong Song <yunlong.song@huawei.com>
> Date: Wed, 22 Feb 2017 20:50:49 +0800
> Subject: [PATCH] f2fs: do SSR for data when there is enough free space
>
> In allocate_segment_by_default(), need_SSR() already detected it's time to do
> SSR. So, let's try to find victims for data segments more aggressively in time.
>
> Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
> ---
>  fs/f2fs/segment.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
> index d01ee7b94702..c27dab43c42f 100644
> --- a/fs/f2fs/segment.c
> +++ b/fs/f2fs/segment.c
> @@ -1541,7 +1541,7 @@ static int get_ssr_segment(struct f2fs_sb_info *sbi, int type)
>  	struct curseg_info *curseg = CURSEG_I(sbi, type);
>  	const struct victim_selection *v_ops = DIRTY_I(sbi)->v_ops;
>  
> -	if (IS_NODESEG(type) || !has_not_enough_free_secs(sbi, 0, 0))
> +	if (IS_NODESEG(type))
>  		return v_ops->get_victim(sbi,
>  				&(curseg)->next_segno, BG_GC, type, SSR);
>  


-- 
Thanks,
Yunlong Song

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web