All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hou Pengyang <houpengyang@huawei.com>
To: Jaegeuk Kim <jaegeuk@kernel.org>
Cc: linux-f2fs-devel@lists.sourceforge.net
Subject: Re: [PATCH 3/3] f2fs: skip dirty bitmap scanning when no dirty segments
Date: Fri, 24 Feb 2017 10:01:48 +0800	[thread overview]
Message-ID: <58AF940C.1020404@huawei.com> (raw)
In-Reply-To: <20170223190303.GC2026@jaegeuk.local>

On 2017/2/24 3:03, Jaegeuk Kim wrote:
> Hi Pengyang,
>
> On 02/23, Hou Pengyang wrote:
>> Signed-off-by: Hou Pengyang <houpengyang@huawei.com>
>> ---
>>   fs/f2fs/gc.c | 13 +++++++++++--
>>   1 file changed, 11 insertions(+), 2 deletions(-)
>>
>> diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c
>> index 6c996e3..eaf9e68 100644
>> --- a/fs/f2fs/gc.c
>> +++ b/fs/f2fs/gc.c
>> @@ -293,13 +293,22 @@ static int get_victim_by_default(struct f2fs_sb_info *sbi,
>>   	unsigned int secno, last_victim;
>>   	unsigned int last_segment = MAIN_SEGS(sbi);
>>   	unsigned int nsearched = 0;
>> +	int nr_dirty;
>>
>>   	mutex_lock(&dirty_i->seglist_lock);
>>
>>   	p.alloc_mode = alloc_mode;
>> -	select_policy(sbi, gc_type, type, &p);
>> -
>>   	p.min_segno = NULL_SEGNO;
>> +
>> +	if (alloc_mode == SSR)
>> +		nr_dirty = dirty_i->nr_dirty[type];
>> +	else
>> +		nr_dirty = dirty_i->nr_dirty[DIRTY];
>> +
>> +	if (!nr_dirty)
>> +		goto out;
>> +
>> +	select_policy(sbi, gc_type, type, &p);
>>   	p.min_cost = get_max_cost(sbi, &p);
>>
>>   	if (p.max_search == 0)
>
> Here, max_search will return if there is no candidate.

Got it :)
Thanks,

>
> Thanks,
>
>> --
>> 2.10.1
>>
>>
>> ------------------------------------------------------------------------------
>> Check out the vibrant tech community on one of the world's most
>> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
>> _______________________________________________
>> Linux-f2fs-devel mailing list
>> Linux-f2fs-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
>
> .
>



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot

  reply	other threads:[~2017-02-24  2:02 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-23  9:18 [PATCH 1/3] f2fs: init local extent_info to avoid stale stack info in tp Hou Pengyang
2017-02-23  9:18 ` [PATCH 2/3] f2fs: remove unsafe bitmap checking Hou Pengyang
2017-02-24 11:12   ` Chao Yu
2017-02-24 17:45     ` Jaegeuk Kim
2017-02-25  0:52       ` Chao Yu
2017-02-25  2:03         ` Jaegeuk Kim
2017-02-25  2:14           ` Chao Yu
2017-02-25 18:11             ` Jaegeuk Kim
2017-02-23  9:18 ` [PATCH 3/3] f2fs: skip dirty bitmap scanning when no dirty segments Hou Pengyang
2017-02-23 19:03   ` Jaegeuk Kim
2017-02-24  2:01     ` Hou Pengyang [this message]
2017-02-24 11:09 ` [PATCH 1/3] f2fs: init local extent_info to avoid stale stack info in tp Chao Yu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=58AF940C.1020404@huawei.com \
    --to=houpengyang@huawei.com \
    --cc=jaegeuk@kernel.org \
    --cc=linux-f2fs-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.