From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751662AbeA2IfV (ORCPT ); Mon, 29 Jan 2018 03:35:21 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:4742 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751603AbeA2IfT (ORCPT ); Mon, 29 Jan 2018 03:35:19 -0500 Subject: Re: [PATCH] f2fs: fix heap mode to reset it back To: Chao Yu , , , CC: , , , , , , References: <1517197065-156255-1-git-send-email-yunlong.song@huawei.com> From: Yunlong Song Message-ID: <607de57c-f5d8-2f22-b79d-4966a8516d1e@huawei.com> Date: Mon, 29 Jan 2018 16:31:26 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [10.111.220.140] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The old commit allocates hot data & nodes in the beginning of partition both for heap and noheap mode. But from the commit message, the heap mode should be like before, i.e., allocate hot data & nodes from curseg to left. On 2018/1/29 16:12, Chao Yu wrote: > Hi Yunlong, > > On 2018/1/29 11:37, Yunlong Song wrote: >> Commit 7a20b8a61eff81bdb7097a578752a74860e9d142 ("f2fs: allocate node >> and hot data in the beginning of partition") introduces another mount >> option, heap, to reset it back. But it does not do anything for heap >> mode, so fix it. > I think Jaegeuk did three things in that patch: > a) add missing heap mount option handling in ->show_options. > b) set noheap by default. > c) change allocation policy to the one that allocate hotdata & nodes in the > front of main are intensively. > > They could be separated, independent, and I don't see such intention that > we can only use c) the new introduced allocation policy in noheap mode. > > Anyway, I think Jaegeuk can help to double check that. > > Thanks, > >> Signed-off-by: Yunlong Song >> --- >> fs/f2fs/gc.c | 5 +++-- >> fs/f2fs/segment.c | 3 ++- >> 2 files changed, 5 insertions(+), 3 deletions(-) >> >> diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c >> index aa720cc..b9d93fd 100644 >> --- a/fs/f2fs/gc.c >> +++ b/fs/f2fs/gc.c >> @@ -191,8 +191,9 @@ static void select_policy(struct f2fs_sb_info *sbi, int gc_type, >> if (gc_type != FG_GC && p->max_search > sbi->max_victim_search) >> p->max_search = sbi->max_victim_search; >> >> - /* let's select beginning hot/small space first */ >> - if (type == CURSEG_HOT_DATA || IS_NODESEG(type)) >> + /* let's select beginning hot/small space first in no_heap mode*/ >> + if (test_opt(sbi, NOHEAP) && >> + (type == CURSEG_HOT_DATA || IS_NODESEG(type))) >> p->offset = 0; >> else >> p->offset = SIT_I(sbi)->last_victim[p->gc_mode]; >> diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c >> index e5739ce..77a48c4 100644 >> --- a/fs/f2fs/segment.c >> +++ b/fs/f2fs/segment.c >> @@ -2167,7 +2167,8 @@ static unsigned int __get_next_segno(struct f2fs_sb_info *sbi, int type) >> if (sbi->segs_per_sec != 1) >> return CURSEG_I(sbi, type)->segno; >> >> - if (type == CURSEG_HOT_DATA || IS_NODESEG(type)) >> + if (test_opt(sbi, NOHEAP) && >> + (type == CURSEG_HOT_DATA || IS_NODESEG(type))) >> return 0; >> >> if (SIT_I(sbi)->last_victim[ALLOC_NEXT]) >> > > . > -- Thanks, Yunlong Song