Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp4252821ybv; Sun, 16 Feb 2020 17:44:03 -0800 (PST) X-Google-Smtp-Source: APXvYqwKzLQdhZ6qRbhoXwMLbKq4f/c702z/3wmaXoz/GjeyXIwHQmDjfJyK0WVBIaFdZBgqlwqE X-Received: by 2002:a9d:6548:: with SMTP id q8mr8372345otl.356.1581903843703; Sun, 16 Feb 2020 17:44:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581903843; cv=none; d=google.com; s=arc-20160816; b=OMobPNGw/QdKx7OJhv/DAtR7z9ORjL29vee8ds/4ni4o4rYi40vU0Qebi6f5wO0YfE 7ZgqiUHw2YmCdag3CdTTMw+chx5uU3H2w790tZhVIoTtEBy5vE3iuZBsanumvWqNJ5+V QKY/ss998ZP6AaCLo45z/RlAU8x0xHFWeXRu+ZNWRsBsrMk0E848YeAHHB4H5CRfNDVe tcuYUZIewEr+UCtlg/gn+pQlbPmRPCyT401YISzjCJihH8H4hFTLteItMbROrpEWtTa/ bw8PSRZmmc3oLWsiEatIU2LQCs9xJjeLxrvAp8Jh7uD5quH8BGpLv6fLcCfd6uBEvM+g 39WA== 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:to:subject; bh=DGR19/jpPmB+7sgZk70tFWUnhSGXqbZWwR9/XcPUNDU=; b=QIx8D4R0XWX0PKPrR8ksVa8treVXwFAwTlUWPXqBsFpS6+lijmRITZkW9rJE2iQ40y Kf6H3crrTFCiE/8Lir8CIruV33gx16AYlBqC35g/QQBqQKt811jHbKCCA9bWvBNtl+Ap k5DPrjOMF9DxjsbGa0UwLm4LJfkY85kinii4Z9BcxhHYfA6BLlCTrsBmlTNdNcnadKmk oXqijgpcqp2Q95laA6LdaRwqB9pEQNGgVAiV/R9QLdKB8Lan55OP/O/KtITrxOG0rd8U 4CTknRkdc/0HXVQfP+Srv8Cj6aMk9c7EUd16fXpfnuYh9yYoM4yojnvg3fYVXJw+Ch14 naeQ== 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 l17si6305933otk.218.2020.02.16.17.43.51; Sun, 16 Feb 2020 17:44:03 -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 S1726485AbgBQBnR (ORCPT + 99 others); Sun, 16 Feb 2020 20:43:17 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:10623 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726251AbgBQBnQ (ORCPT ); Sun, 16 Feb 2020 20:43:16 -0500 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id E7242A1C8C2048FB5443; Mon, 17 Feb 2020 09:43:14 +0800 (CST) Received: from [10.134.22.195] (10.134.22.195) by smtp.huawei.com (10.3.19.206) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 17 Feb 2020 09:43:10 +0800 Subject: Re: [f2fs-dev] [PATCH 2/3] f2fs: add migration count iff migration happens To: Jaegeuk Kim , , References: <20200214185855.217360-1-jaegeuk@kernel.org> <20200214185855.217360-2-jaegeuk@kernel.org> From: Chao Yu Message-ID: <8b66e722-202b-b3b8-1543-e74379319a7f@huawei.com> Date: Mon, 17 Feb 2020 09:43:09 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20200214185855.217360-2-jaegeuk@kernel.org> 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 BTW f2fs: add migration count iff migration happens typo: iff On 2020/2/15 2:58, Jaegeuk Kim wrote: > If first segment is empty and migration_granularity is 1, we can't move this > at all. > > Signed-off-by: Jaegeuk Kim > --- > fs/f2fs/gc.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c > index 65c0687ee2bb..bbf4db3f6bb4 100644 > --- a/fs/f2fs/gc.c > +++ b/fs/f2fs/gc.c > @@ -1233,12 +1233,12 @@ static int do_garbage_collect(struct f2fs_sb_info *sbi, > segno, gc_type); > > stat_inc_seg_count(sbi, type, gc_type); > + migrated++; > > freed: > if (gc_type == FG_GC && > get_valid_blocks(sbi, segno, false) == 0) > seg_freed++; > - migrated++; > > if (__is_large_section(sbi) && segno + 1 < end_segno) > sbi->next_victim_seg[gc_type] = segno + 1; >