* [PATCH] f2fs: clear get_ssr_cost
@ 2017-09-01 12:14 Yunlong Song
2017-09-04 1:17 ` Chao Yu
2017-09-04 3:10 ` [PATCH v2] Revert "f2fs: add a new function get_ssr_cost" Yunlong Song
0 siblings, 2 replies; 5+ messages in thread
From: Yunlong Song @ 2017-09-01 12:14 UTC (permalink / raw)
To: jaegeuk, chao, yuchao0, yunlong.song, yunlong.song
Cc: miaoxie, bintian.wang, linux-fsdevel, linux-f2fs-devel, linux-kernel
se->ckpt_valid_blocks is always larger than se->valid_blocks, so
get_ssr_cost can be cleared.
Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
---
fs/f2fs/gc.c | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index cd147e7..b226760 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -277,20 +277,11 @@ static unsigned int get_greedy_cost(struct f2fs_sb_info *sbi,
valid_blocks * 2 : valid_blocks;
}
-static unsigned int get_ssr_cost(struct f2fs_sb_info *sbi,
- unsigned int segno)
-{
- struct seg_entry *se = get_seg_entry(sbi, segno);
-
- return se->ckpt_valid_blocks > se->valid_blocks ?
- se->ckpt_valid_blocks : se->valid_blocks;
-}
-
static inline unsigned int get_gc_cost(struct f2fs_sb_info *sbi,
unsigned int segno, struct victim_sel_policy *p)
{
if (p->alloc_mode == SSR)
- return get_ssr_cost(sbi, segno);
+ return get_seg_entry(sbi, segno)->ckpt_valid_blocks;
/* alloc_mode == LFS */
if (p->gc_mode == GC_GREEDY)
--
1.8.5.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] f2fs: clear get_ssr_cost
2017-09-01 12:14 [PATCH] f2fs: clear get_ssr_cost Yunlong Song
@ 2017-09-04 1:17 ` Chao Yu
2017-09-04 1:54 ` Yunlong Song
2017-09-04 3:10 ` [PATCH v2] Revert "f2fs: add a new function get_ssr_cost" Yunlong Song
1 sibling, 1 reply; 5+ messages in thread
From: Chao Yu @ 2017-09-04 1:17 UTC (permalink / raw)
To: Yunlong Song, jaegeuk, chao, yunlong.song
Cc: miaoxie, bintian.wang, linux-fsdevel, linux-f2fs-devel, linux-kernel
On 2017/9/1 20:14, Yunlong Song wrote:
> se->ckpt_valid_blocks is always larger than se->valid_blocks, so
> get_ssr_cost can be cleared.
I think this is not correct.
Thanks,
>
> Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
> ---
> fs/f2fs/gc.c | 11 +----------
> 1 file changed, 1 insertion(+), 10 deletions(-)
>
> diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
> index cd147e7..b226760 100644
> --- a/fs/f2fs/gc.c
> +++ b/fs/f2fs/gc.c
> @@ -277,20 +277,11 @@ static unsigned int get_greedy_cost(struct f2fs_sb_info *sbi,
> valid_blocks * 2 : valid_blocks;
> }
>
> -static unsigned int get_ssr_cost(struct f2fs_sb_info *sbi,
> - unsigned int segno)
> -{
> - struct seg_entry *se = get_seg_entry(sbi, segno);
> -
> - return se->ckpt_valid_blocks > se->valid_blocks ?
> - se->ckpt_valid_blocks : se->valid_blocks;
> -}
> -
> static inline unsigned int get_gc_cost(struct f2fs_sb_info *sbi,
> unsigned int segno, struct victim_sel_policy *p)
> {
> if (p->alloc_mode == SSR)
> - return get_ssr_cost(sbi, segno);
> + return get_seg_entry(sbi, segno)->ckpt_valid_blocks;
>
> /* alloc_mode == LFS */
> if (p->gc_mode == GC_GREEDY)
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] f2fs: clear get_ssr_cost
2017-09-04 1:17 ` Chao Yu
@ 2017-09-04 1:54 ` Yunlong Song
2017-09-04 2:48 ` Chao Yu
0 siblings, 1 reply; 5+ messages in thread
From: Yunlong Song @ 2017-09-04 1:54 UTC (permalink / raw)
To: Chao Yu, jaegeuk, chao, yunlong.song
Cc: miaoxie, bintian.wang, linux-fsdevel, linux-f2fs-devel, linux-kernel
The update_sit_entry provides this:
...
1658 if (!f2fs_test_bit(offset, se->ckpt_valid_map))
1659 se->ckpt_valid_blocks += del;
...
As a result, the ckpt_valid_blocks is always larger than valid_blocks.
If not correct, can you provide
the case valid_blocks larger than ckpt_valid_blocks?
On 2017/9/4 9:17, Chao Yu wrote:
> On 2017/9/1 20:14, Yunlong Song wrote:
>> se->ckpt_valid_blocks is always larger than se->valid_blocks, so
>> get_ssr_cost can be cleared.
> I think this is not correct.
>
> Thanks,
>
>> Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
>> ---
>> fs/f2fs/gc.c | 11 +----------
>> 1 file changed, 1 insertion(+), 10 deletions(-)
>>
>> diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
>> index cd147e7..b226760 100644
>> --- a/fs/f2fs/gc.c
>> +++ b/fs/f2fs/gc.c
>> @@ -277,20 +277,11 @@ static unsigned int get_greedy_cost(struct f2fs_sb_info *sbi,
>> valid_blocks * 2 : valid_blocks;
>> }
>>
>> -static unsigned int get_ssr_cost(struct f2fs_sb_info *sbi,
>> - unsigned int segno)
>> -{
>> - struct seg_entry *se = get_seg_entry(sbi, segno);
>> -
>> - return se->ckpt_valid_blocks > se->valid_blocks ?
>> - se->ckpt_valid_blocks : se->valid_blocks;
>> -}
>> -
>> static inline unsigned int get_gc_cost(struct f2fs_sb_info *sbi,
>> unsigned int segno, struct victim_sel_policy *p)
>> {
>> if (p->alloc_mode == SSR)
>> - return get_ssr_cost(sbi, segno);
>> + return get_seg_entry(sbi, segno)->ckpt_valid_blocks;
>>
>> /* alloc_mode == LFS */
>> if (p->gc_mode == GC_GREEDY)
>>
>
> .
>
--
Thanks,
Yunlong Song
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] f2fs: clear get_ssr_cost
2017-09-04 1:54 ` Yunlong Song
@ 2017-09-04 2:48 ` Chao Yu
0 siblings, 0 replies; 5+ messages in thread
From: Chao Yu @ 2017-09-04 2:48 UTC (permalink / raw)
To: Yunlong Song, jaegeuk, chao, yunlong.song
Cc: miaoxie, bintian.wang, linux-fsdevel, linux-f2fs-devel, linux-kernel
On 2017/9/4 9:54, Yunlong Song wrote:
> The update_sit_entry provides this:
> ...
> 1658 if (!f2fs_test_bit(offset, se->ckpt_valid_map))
> 1659 se->ckpt_valid_blocks += del;
> ...
> As a result, the ckpt_valid_blocks is always larger than valid_blocks.
> If not correct, can you provide
> the case valid_blocks larger than ckpt_valid_blocks?
Oh, I just nit-pick, :), how about using 'se->ckpt_valid_blocks will never be
smaller than se->valid_blocks' instead?
And could you just revert Yunlei's patch and add above commit log?
Thanks,
>
> On 2017/9/4 9:17, Chao Yu wrote:
>> On 2017/9/1 20:14, Yunlong Song wrote:
>>> se->ckpt_valid_blocks is always larger than se->valid_blocks, so
>>> get_ssr_cost can be cleared.
>> I think this is not correct.
>>
>> Thanks,
>>
>>> Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
>>> ---
>>> fs/f2fs/gc.c | 11 +----------
>>> 1 file changed, 1 insertion(+), 10 deletions(-)
>>>
>>> diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
>>> index cd147e7..b226760 100644
>>> --- a/fs/f2fs/gc.c
>>> +++ b/fs/f2fs/gc.c
>>> @@ -277,20 +277,11 @@ static unsigned int get_greedy_cost(struct f2fs_sb_info *sbi,
>>> valid_blocks * 2 : valid_blocks;
>>> }
>>>
>>> -static unsigned int get_ssr_cost(struct f2fs_sb_info *sbi,
>>> - unsigned int segno)
>>> -{
>>> - struct seg_entry *se = get_seg_entry(sbi, segno);
>>> -
>>> - return se->ckpt_valid_blocks > se->valid_blocks ?
>>> - se->ckpt_valid_blocks : se->valid_blocks;
>>> -}
>>> -
>>> static inline unsigned int get_gc_cost(struct f2fs_sb_info *sbi,
>>> unsigned int segno, struct victim_sel_policy *p)
>>> {
>>> if (p->alloc_mode == SSR)
>>> - return get_ssr_cost(sbi, segno);
>>> + return get_seg_entry(sbi, segno)->ckpt_valid_blocks;
>>>
>>> /* alloc_mode == LFS */
>>> if (p->gc_mode == GC_GREEDY)
>>>
>>
>> .
>>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2] Revert "f2fs: add a new function get_ssr_cost"
2017-09-01 12:14 [PATCH] f2fs: clear get_ssr_cost Yunlong Song
2017-09-04 1:17 ` Chao Yu
@ 2017-09-04 3:10 ` Yunlong Song
1 sibling, 0 replies; 5+ messages in thread
From: Yunlong Song @ 2017-09-04 3:10 UTC (permalink / raw)
To: jaegeuk, chao, yuchao0, yunlong.song, yunlong.song
Cc: miaoxie, bintian.wang, linux-fsdevel, linux-f2fs-devel, linux-kernel
This reverts commit b7b7c4cf1c9ef0272a65f1480457cbfdadcda19d.
se->ckpt_valid_blocks will never be smaller than se->valid_blocks, so just
remove get_ssr_cost.
Signed-off-by: Yunlong Song <yunlong.song@huawei.com>
Signed-off-by: Chao Yu <yuchao0@huawei.com>
---
fs/f2fs/gc.c | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
index cd147e7..b226760 100644
--- a/fs/f2fs/gc.c
+++ b/fs/f2fs/gc.c
@@ -277,20 +277,11 @@ static unsigned int get_greedy_cost(struct f2fs_sb_info *sbi,
valid_blocks * 2 : valid_blocks;
}
-static unsigned int get_ssr_cost(struct f2fs_sb_info *sbi,
- unsigned int segno)
-{
- struct seg_entry *se = get_seg_entry(sbi, segno);
-
- return se->ckpt_valid_blocks > se->valid_blocks ?
- se->ckpt_valid_blocks : se->valid_blocks;
-}
-
static inline unsigned int get_gc_cost(struct f2fs_sb_info *sbi,
unsigned int segno, struct victim_sel_policy *p)
{
if (p->alloc_mode == SSR)
- return get_ssr_cost(sbi, segno);
+ return get_seg_entry(sbi, segno)->ckpt_valid_blocks;
/* alloc_mode == LFS */
if (p->gc_mode == GC_GREEDY)
--
1.8.5.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-09-04 3:10 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-09-01 12:14 [PATCH] f2fs: clear get_ssr_cost Yunlong Song
2017-09-04 1:17 ` Chao Yu
2017-09-04 1:54 ` Yunlong Song
2017-09-04 2:48 ` Chao Yu
2017-09-04 3:10 ` [PATCH v2] Revert "f2fs: add a new function get_ssr_cost" Yunlong Song
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).