From nobody Tue Nov 26 03:43:58 2024 Received: from SHSQR01.spreadtrum.com (unknown [222.66.158.135]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 410F22209B for ; Tue, 22 Oct 2024 09:15:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=222.66.158.135 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729588545; cv=none; b=pO0C+oKyae2edbwzNs5xmEE4xdpqEwwsMGEYAtc0Qnko/YHXZ5iIPRJwjsOzOQv0GbP3O8prJdBvuP/PIT/L+QCQcBw2vXwNBQqBhB1VnCbo4cena1GTDSE0y6eJZtkZgeNlhNFtdMM+t6Eegbq/4UVHcIFBjWu4T0eqCB+fyhA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729588545; c=relaxed/simple; bh=NAHGUXsS3hZNDQRO9ZdgsXdpOltmpO8UvoAot9VkBS0=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=YNIKRyXBOvtR0ZE1FU/FhR7P5uaaEeTUYcbrt6yNqL1TB7JKyfpTGlnR9IGxTLTYqaAU1y9h1l8YHqHMxYr/3TY1aMPXD/NL0uaZ0Q8oapY0mVXkzxGVRdX/1lEEpAyoef6xqOWkMQkG7yNJ+wM9bdo6SStm9amHsPi4LaMcuzE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=unisoc.com; spf=pass smtp.mailfrom=unisoc.com; arc=none smtp.client-ip=222.66.158.135 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=unisoc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=unisoc.com Received: from dlp.unisoc.com ([10.29.3.86]) by SHSQR01.spreadtrum.com with ESMTP id 49M9Exu2025686; Tue, 22 Oct 2024 17:14:59 +0800 (+08) (envelope-from Zhiguo.Niu@unisoc.com) Received: from SHDLP.spreadtrum.com (bjmbx02.spreadtrum.com [10.0.64.8]) by dlp.unisoc.com (SkyGuard) with ESMTPS id 4XXmhs3wV7z2Q4Wxt; Tue, 22 Oct 2024 17:14:37 +0800 (CST) Received: from bj08434pcu.spreadtrum.com (10.0.73.87) by BJMBX02.spreadtrum.com (10.0.64.8) with Microsoft SMTP Server (TLS) id 15.0.1497.23; Tue, 22 Oct 2024 17:14:57 +0800 From: Zhiguo Niu To: , CC: , , , , , Subject: [PATCH] f2fs: fix to avoid use GC_AT when setting gc_mode as GC_URGENT_MID Date: Tue, 22 Oct 2024 17:14:41 +0800 Message-ID: <1729588481-29390-1-git-send-email-zhiguo.niu@unisoc.com> X-Mailer: git-send-email 1.9.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ClientProxiedBy: SHCAS03.spreadtrum.com (10.0.1.207) To BJMBX02.spreadtrum.com (10.0.64.8) X-MAIL: SHSQR01.spreadtrum.com 49M9Exu2025686 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" GC_URGENT_MID is introduced by commit d98af5f45520 ("f2fs: introduce gc_urgent_mid mode"), aim to does GC forcibly uses cost benefit GC approach, but if ATGC is enabled at the same time, Age-threshold approach will be selected, which can only do amount of GC and it is much less than the numbers of CB approach. some traces: f2fs_gc-254:48-396 [007] ..... 2311600.684028: f2fs_gc_begin: dev =3D= (254,48), gc_type =3D Background GC, no_background_GC =3D 0, nr_free_secs = =3D 0, nodes =3D 1053, dents =3D 2, imeta =3D 18, free_sec:44898, free_seg:= 44898, rsv_seg:239, prefree_seg:0 f2fs_gc-254:48-396 [007] ..... 2311600.684527: f2fs_get_victim: dev = =3D (254,48), type =3D No TYPE, policy =3D (Background GC, LFS-mode, Age-th= reshold), victim =3D 10, cost =3D 4294364975, ofs_unit =3D 1, pre_victim_se= cno =3D -1, prefree =3D 0, free =3D 44898 f2fs_gc-254:48-396 [007] ..... 2311600.714835: f2fs_gc_end: dev =3D (= 254,48), ret =3D 0, seg_freed =3D 0, sec_freed =3D 0, nodes =3D 1562, dents= =3D 2, imeta =3D 18, free_sec:44898, free_seg:44898, rsv_seg:239, prefree_= seg:0 f2fs_gc-254:48-396 [007] ..... 2311600.714843: f2fs_background_gc: de= v =3D (254,48), wait_ms =3D 50, prefree =3D 0, free =3D 44898 f2fs_gc-254:48-396 [007] ..... 2311600.771785: f2fs_gc_begin: dev =3D= (254,48), gc_type =3D Background GC, no_background_GC =3D 0, nr_free_secs = =3D 0, nodes =3D 1562, dents =3D 2, imeta =3D 18, free_sec:44898, free_seg:= 44898, rsv_seg:239, prefree_seg: f2fs_gc-254:48-396 [007] ..... 2311600.772275: f2fs_gc_end: dev =3D (= 254,48), ret =3D -61, seg_freed =3D 0, sec_freed =3D 0, nodes =3D 1562, den= ts =3D 2, imeta =3D 18, free_sec:44898, free_seg:44898, rsv_seg:239, prefre= e_seg:0 Fixes: d98af5f45520 ("f2fs: introduce gc_urgent_mid mode") Signed-off-by: Zhiguo Niu --- fs/f2fs/gc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index e40bdd1..daecf69 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -257,6 +257,7 @@ static int select_gc_type(struct f2fs_sb_info *sbi, int= gc_type) =20 switch (sbi->gc_mode) { case GC_IDLE_CB: + case GC_URGENT_MID: gc_mode =3D GC_CB; break; case GC_IDLE_GREEDY: --=20 1.9.1