Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp2077846ybv; Fri, 14 Feb 2020 11:02:27 -0800 (PST) X-Google-Smtp-Source: APXvYqwaeH2CqsM9zaIcnAP+SIE1ivXb/PnHsm71tvop4DrqrRRdxorUKg/nXqX/riRlFc3YjxhN X-Received: by 2002:a54:468b:: with SMTP id k11mr2792157oic.134.1581706947730; Fri, 14 Feb 2020 11:02:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1581706947; cv=none; d=google.com; s=arc-20160816; b=i/LWIK2N9bmGQjIC830qOmjl2nlBlX8lhX6dBeP25SOwSBauOiDoKG1wMuxLusstaR SY6rKXqdwK/QJBfC4FMqlQzJlsbAbZcWZ97e3cdKMJR8LVd5G7AOWVcBH8uGviNWgKms PoCckCXsEEjo+Ju96hAnXxvmkeaMLlY6o295DlCSLIs9GmHsqd6U+DhpgiO1nY2SNCqI NlmnbTYQrDLYzlzTwSOZMciqGdNyyKMRuheSOuCfIT1Q7rhpRrQwzkHofMbfWUO0l5kh 2kRmJUCWp7bpRnogI4JhvK/tAo7a331eMx3XefTfqitGd1TbUOzyVPmUdWxihuC+BNI5 KaGA== 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:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=b2qJTgZKMKQixAvFyMxnoapoUdu8/RT0hYcDeidaS60=; b=g+j2tepPyMZswYjuDCtLJTV83anbLGO2dCHpfLAs+/oIi4+lZniqGxI8VWE2B3geV1 lKyvQNmRa0VLeLos6cPbEum//EnZWC09N9WsCJ+EvQ1aAyj4IedWvVDmbouchzjSUmUQ 4lUbS/4vIe9Yn1gMP6XjdseJDY7VGvJDNb+jI+wkkd6SPdYlvqBL3PraqVVUWwJlqRnF 44MsXYN9becSENWVUpXl1bIc3UopP8lV4ws4KHAmd5M3i6Cw6ndmnDRVnksLaOYvvWKK uwKU2QLEUP7xtHJrtbOVVQEg/rhjpRQH71Ab31gOyyUMaThfKljmFhKqTzn4hRRwMMdw bApg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="H3/JM0B4"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e15si3531606otq.237.2020.02.14.11.02.15; Fri, 14 Feb 2020 11:02:27 -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; dkim=pass header.i=@kernel.org header.s=default header.b="H3/JM0B4"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387952AbgBNS7I (ORCPT + 99 others); Fri, 14 Feb 2020 13:59:08 -0500 Received: from mail.kernel.org ([198.145.29.99]:46140 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387537AbgBNS66 (ORCPT ); Fri, 14 Feb 2020 13:58:58 -0500 Received: from localhost (unknown [104.132.1.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D354022314; Fri, 14 Feb 2020 18:58:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1581706737; bh=rDuZDiF8LTia0x0F357avgt8TEOw/x+rB4MF/F1tReE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=H3/JM0B4pLm2N/iLytENA9CoC5JNNY7xiTbNXgPklcwuJ136fxZO1GjfqWLQjSyjU q9m6F0ra6RcWGlwc8Iq+PfxHKIgVxpDud1ViYpAwbkhyOuRqMDN5EO1eoM/bpyPXL4 T8qjYBwcRzWP/RITcUqxsqkNUxDKIVTHrzaUht70= From: Jaegeuk Kim To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Cc: Jaegeuk Kim Subject: [PATCH 2/3] f2fs: add migration count iff migration happens Date: Fri, 14 Feb 2020 10:58:54 -0800 Message-Id: <20200214185855.217360-2-jaegeuk@kernel.org> X-Mailer: git-send-email 2.25.0.265.gbab2e86ba0-goog In-Reply-To: <20200214185855.217360-1-jaegeuk@kernel.org> References: <20200214185855.217360-1-jaegeuk@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; -- 2.25.0.265.gbab2e86ba0-goog