Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp2852514iob; Fri, 6 May 2022 11:46:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxTfJugP1fUPoS/oy/dQL14P6Md6hqOBunAJ8GWiBnU2Xu9aoyCzK3i/qlZcVndwVfeEX2k X-Received: by 2002:a05:6402:4313:b0:427:ca44:5d5e with SMTP id m19-20020a056402431300b00427ca445d5emr5013907edc.67.1651862813126; Fri, 06 May 2022 11:46:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651862813; cv=none; d=google.com; s=arc-20160816; b=J49VuYm3o8qsUfBXOn7QiQtx3cTt91o0KyB3nwHuKNVl6vu3Wn54idGboFIkMfI4Ax Dhx2IWTNENgVsiIK4O1M7stxC49OU3V1suZlzcOFeqqSNpB7adTIu1ozDtEQLqc5RyTS zljZfJUGFLLkphWQgNq98mqNADzXRrfdeqPaffIgR54/ixkhj09ayo/exUyLAex9nTzt CvZgauLLxwJBpMa83o/xQR7Z/u64F6MZ3DrsJdH+I1sJO0Yl2sTnyZ72KxdHlXEZLAKw TKLiCEQsFFzrSAF6YARAfDvKD4wjZR+T3okG1pyifsAj/DqKMh1BbtvMS4g05rN/1/j7 69XQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:to:from:date:dkim-signature; bh=naxLxOVKAPm2Jaro+LEcbo24jZG+euVPOx89u+mrym8=; b=EYcszunYbg1c/eYEacmakgvsh0LNcpjRPl4thW+DxCOEfim6cJxvLgqgQodJO6N2kd OXnFNi192QaEEwSvzvVWbkXxfONZM4AkQpkXETbCTNEiEVZsyV6ugkmFIRkuzZhcP0Ng 9+M2NxRv2jYJzC/vuaVvq4juTHuo4yd3etIcGQlz1pZy+zEwNKyyBKnu3iJi3fZXUaPW 0imP+Rg/rhlAh5VN3CwO/DXOXguU9LpF/8b+aYatQOdzcPnCe4z559BTwcrjCW2+2iLH lsPMtM0h1ExhyMFMcHvPb3+4hRqDZmla1n/u6/pT1wxW9PBQEKhdwexIEbGDsueHQG0X jiWQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Jb1H+umW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id he42-20020a1709073daa00b006f51c69d393si2111247ejc.87.2022.05.06.11.46.27; Fri, 06 May 2022 11:46:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Jb1H+umW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S1346069AbiEDU0f (ORCPT + 99 others); Wed, 4 May 2022 16:26:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58404 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349645AbiEDU0d (ORCPT ); Wed, 4 May 2022 16:26:33 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44A3D4EDE1 for ; Wed, 4 May 2022 13:22:57 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D001B612A8 for ; Wed, 4 May 2022 20:22:56 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 256CEC385A4; Wed, 4 May 2022 20:22:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1651695776; bh=Pvp/ayE3bEr1ThzltiOs0liNClPGDqGM57U4y3ZJCs4=; h=Date:From:To:Subject:References:In-Reply-To:From; b=Jb1H+umWfnfEpWqRV20Q4YhcGwRLYGWiL464vbh1AFJeLggogbh3DgfdhCRMeUThT XNv5jkVDb09twhYv4kQ1HPTEvqpD1A9rDMXWas6eF0Jch8V8bWocjrGjgjvTI+7mDE k7Y4wuNJ7sFd1PkbhH3cM6NHpPU1kH27+95u07THwk2LSvSKMFS64PEaeWAgBWwbUB /5eZqJHkZ1yfcpEKtZl1G8IndjStS3uqXjjaoyGrAFWo2Peiti6Tcqz7VBE9BDTxu8 bqmYMdQzVyQ4v5wiU/pYIPJu5AEzmRtqdnpmupU4kAkDSIubdwgG8wWaPAPEOM0Vya PG1KYfPHXeaQg== Date: Wed, 4 May 2022 13:22:54 -0700 From: Jaegeuk Kim To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Subject: Re: [PATCH 2/2 v2] f2fs: avoid to select pinned section during checkpoint=disable Message-ID: References: <20220503203040.365028-1-jaegeuk@kernel.org> <20220503203040.365028-2-jaegeuk@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220503203040.365028-2-jaegeuk@kernel.org> X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The f2fs_gc uses a bitmap to indicate pinned sections, but when disabling chckpoint, we call f2fs_gc() with NULL_SEGNO which selects the same dirty segment as a victim all the time, resulting in checkpoint=disable failure. Let's pick another one, if we fail to collect it. Signed-off-by: Jaegeuk Kim --- Change log from v1: - keep sync condition to stop GC fs/f2fs/gc.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index 4d47723523c3..441190ab8593 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -1838,10 +1838,7 @@ int f2fs_gc(struct f2fs_sb_info *sbi, bool sync, if (gc_type == FG_GC) sbi->cur_victim_sec = NULL_SEGNO; - if (sync) - goto stop; - - if (!has_not_enough_free_secs(sbi, sec_freed, 0)) + if ((!has_not_enough_free_secs(sbi, sec_freed, 0) || sync) && seg_freed) goto stop; if (skipped_round <= MAX_SKIP_GC_COUNT || skipped_round * 2 < round) { -- 2.36.0.464.gb9c8b46e94-goog