From mboxrd@z Thu Jan 1 00:00:00 1970 From: Hou Pengyang Subject: Re: [PATCH 3/3] f2fs: skip dirty bitmap scanning when no dirty segments Date: Fri, 24 Feb 2017 10:01:48 +0800 Message-ID: <58AF940C.1020404@huawei.com> References: <20170223091807.36175-1-houpengyang@huawei.com> <20170223091807.36175-3-houpengyang@huawei.com> <20170223190303.GC2026@jaegeuk.local> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from sog-mx-3.v43.ch3.sourceforge.com ([172.29.43.193] helo=mx.sourceforge.net) by sfs-ml-2.v29.ch3.sourceforge.com with esmtp (Exim 4.76) (envelope-from ) id 1ch5D6-0007aW-UO for linux-f2fs-devel@lists.sourceforge.net; Fri, 24 Feb 2017 02:02:16 +0000 Received: from [45.249.212.187] (helo=dggrg01-dlp.huawei.com) by sog-mx-3.v43.ch3.sourceforge.com with esmtps (TLSv1:RC4-SHA:128) (Exim 4.76) id 1ch5D4-0003Jm-RY for linux-f2fs-devel@lists.sourceforge.net; Fri, 24 Feb 2017 02:02:16 +0000 In-Reply-To: <20170223190303.GC2026@jaegeuk.local> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net To: Jaegeuk Kim Cc: linux-f2fs-devel@lists.sourceforge.net On 2017/2/24 3:03, Jaegeuk Kim wrote: > Hi Pengyang, > > On 02/23, Hou Pengyang wrote: >> Signed-off-by: Hou Pengyang >> --- >> 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