Received: by 10.223.176.5 with SMTP id f5csp734407wra; Tue, 30 Jan 2018 18:43:29 -0800 (PST) X-Google-Smtp-Source: AH8x226ZXL3WiDtfrqGZnz3NjgSs+yeLR3kDdd3zry4KEYlgJInm4qtGlhDHeucI/yXd8qTFZIXO X-Received: by 2002:a17:902:3a3:: with SMTP id d32-v6mr26636039pld.193.1517366609615; Tue, 30 Jan 2018 18:43:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517366609; cv=none; d=google.com; s=arc-20160816; b=ogq9wgG/sZZgaJ0N1MVGs0Z6asev/rPRB1DpG2o39UkBIeD3wgNPUaQHkXIuOT28Z9 uBXR0rFcyDnJbkil+oDyfU0PXsPY0ekPfCp9lR1KX6+nS2NCQqkaz89+Rjgfr1+gRGTz /hY0K6md5BiIbOR3PYcV6t188cx411YtW1ITZtkJrVy8/yW9a01PnJ9wDzuq2x/H2xSq X42vz0IyNNGnpK6psMbJVFXsaYdoSKSlJ6FWqGckQnL49XT6ZzWIqQSSoyORSVhqYdSY NEYR2QpLxrY/afkPGR4/2iYl7SXEq2zVIRpG2t1CR8I/4owaQofRcke899QglssZbpVP 8XSg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=Amb0257cmnxEEwvG2YHDC2B2xc7mGKh/SFNQO+7pTBY=; b=vLBSF/8esva+x8qI409LYDlcOksdZXOFN5ATJ64s46OGTBTEmopbD8bFQ/swDmqusp NJFJl/t7HGHgv+r0poN2NccAP58EFon8rXigiAxBlDK19BwrccksKS3yx6kpdCCIna4k wslUMbxqM4NfA/Gr7/g+JxLyCxutLIO3kS6hdDvsFJiZLIv4sja/vQBRFdoL2dywRnyy cMQIO8AhlwJZz8RSqfwgKMpEgOwV14Wa05r1BzHzpm0a3D6nptnLvuMdYTKOZ9mfGlYe Fv+nh1FByZRRm42o/APXJesyyGX6EUzjmkwAtFkFRimvSk5ZYYRhVOvmYQYmXCXSHrkd 12zA== 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 p13-v6si327635pll.84.2018.01.30.18.43.14; Tue, 30 Jan 2018 18:43:29 -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 S1752820AbeAaCUI (ORCPT + 99 others); Tue, 30 Jan 2018 21:20:08 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:46127 "EHLO huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1752367AbeAaCUH (ORCPT ); Tue, 30 Jan 2018 21:20:07 -0500 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id D5F1C91A83619; Wed, 31 Jan 2018 10:19:53 +0800 (CST) Received: from [127.0.0.1] (10.134.22.195) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.361.1; Wed, 31 Jan 2018 10:19:44 +0800 Subject: Re: [PATCH] f2fs: fix heap mode to reset it back To: Jaegeuk Kim CC: Yunlong Song , , , , , , , , , References: <1517197065-156255-1-git-send-email-yunlong.song@huawei.com> <607de57c-f5d8-2f22-b79d-4966a8516d1e@huawei.com> <20180131013946.GF65489@jaegeuk-macbookpro.roam.corp.google.com> From: Chao Yu Message-ID: <5a27e12a-bdbf-d69d-633d-d1be085b46e9@huawei.com> Date: Wed, 31 Jan 2018 10:19:42 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0 MIME-Version: 1.0 In-Reply-To: <20180131013946.GF65489@jaegeuk-macbookpro.roam.corp.google.com> Content-Type: text/plain; charset="windows-1252" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.134.22.195] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018/1/31 9:39, Jaegeuk Kim wrote: > On 01/29, Chao Yu wrote: >> On 2018/1/29 16:31, Yunlong Song wrote: >>> 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. >> >> Let's ping Jaegeuk to check that, :) > > Yup, I missed to add this condition. :) Alright, if so, it needs to Cc stable mailing list, as this patch should fix to reset back allocation policy of heap mode in old kernel too. Reviewed-by: Chao Yu Thanks, > >> >> Thanks, >> >>> >>> 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]) >>>>> >>>> >>>> . >>>> >>> > > . >