Received: by 10.223.176.5 with SMTP id f5csp2602710wra; Mon, 29 Jan 2018 00:36:12 -0800 (PST) X-Google-Smtp-Source: AH8x225eeOoV1nALM6BPF1BPPMOxUjerdzS4qCz7ZG89IOONbL9Bud1Nljr8elPa6mPg3eHJaaHu X-Received: by 2002:a17:902:3f83:: with SMTP id a3-v6mr20618411pld.263.1517214972351; Mon, 29 Jan 2018 00:36:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517214972; cv=none; d=google.com; s=arc-20160816; b=ien3HMFJpkC2jpAoA56MlI50Qx1HK4k+52gkR+Pgivn/u9howVRNDRfmVIAfzNV0qH vcPTPZx948ACew47I9kv8B0q7Ilk6YmXq9jJtVnEDH6zvldFpIHniY9oCsxMKFiF71RM tUEQxF6j024yYnuoMMSAy+JKf4RZZ/c9N6u+QC8y74tLdVPGlNA584TYproO554QbRzA HjCis76O4Y7GEDqgvO7xaf3SmbzoLeeTLAlgrSCFkhr7W7BVHGs3fj0TQ6sE1XhLItZ2 idZatEcBrKpQNbeF0xKDMPEHTqH6n5vixbUV5w0FKsDV0IHP2Fxtxp/3Qz2tEy8L4nIm li+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=lgxoUTg85ZuAtK9D7E4RoFCuoOGPstJZd1PTrrxStMM=; b=JZ+OqoZY+8Q1cjtUNREhpoFg5oeB5sX8upNuMmOb5o/NapOK2C10Ubg2PU06jFs0rH dQeSzlcwcfNHBkNs9gZIpfZDXQdkGZdG2bMjNl9Xl8KGas4VMb4EVIqqrO5v3xD41yOG Jug8vMEXTAl/TkSUo+5+gONrZ7pHPPxtrnePiccra0g0OiJykVDNYoC+SI462RKROrk6 ol1GItD6T2R+6O+Ojb17ByEPs4w+GBKpQFvUQYogtrxfJXv+lk4XLA5wR1jjuumwxCaL GfPVFVXPsmdfRp5+rXARW4x+zb+xSKw+RrOGnccAvxf8tv/QqCbXomDR8k8vMl9ORPGl em+w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v35-v6si8867542plg.724.2018.01.29.00.35.58; Mon, 29 Jan 2018 00:36:12 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751649AbeA2IfU (ORCPT + 99 others); Mon, 29 Jan 2018 03:35:20 -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 Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 1D579E206F3D5; Mon, 29 Jan 2018 16:35:06 +0800 (CST) Received: from [127.0.0.1] (10.111.220.140) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.361.1; Mon, 29 Jan 2018 16:35:00 +0800 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 Precedence: bulk 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