Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp68843rwb; Fri, 19 Aug 2022 17:07:39 -0700 (PDT) X-Google-Smtp-Source: AA6agR7w122WIaCryyKE8aPnttJrZ4uX/oB7VZPmD5kG3Mmf7Krh5cHnhrB5MKQjjDqCusIpCGE5 X-Received: by 2002:a17:907:2cf4:b0:73d:63b3:351b with SMTP id hz20-20020a1709072cf400b0073d63b3351bmr637820ejc.611.1660954059394; Fri, 19 Aug 2022 17:07:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660954059; cv=none; d=google.com; s=arc-20160816; b=EIoWNKCiCjbunhDlFN8ok8Zqkx532fuq+taRXXokQHt6Ze1SZ4TlOnes3faKxoQkur CyA1nEg3h119dfiVVSCmaprLtpMRkNMUtet0AHGscwBOiiExy3AG42rpkVQqlIxeAcmP 6d0AbwC+lbXWtOktHPU5wcNO6nLsDhyqRfkgyrKze9kddUX/CFGP8JH7vrhlgFZvUEZs 15G5p+p1xjO6nSKCP24USEbfTW6WtGeDzB+VOCjoSmUA92HnzPvZiF0yLMIZqxMDySHk poec3stT45nLzRLPDdvz7HOvy/2HwZMpTsr3XyRg/QhcYrgrFRlxF8I6g1N6fEuDIeOE YrJA== 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:cc:to:from:date:dkim-signature; bh=m+r/M+4GAAaG5DDN8rq+0XD94RrIl43ntQ+/u44PZMA=; b=eSNGYgEndi2jpm/QOjLZ/Gf0FtI51uOMo4DvPGFgTTFmp+ziQq+0WahCiNL4fUtM9W UMh8ipiLKa05S+v7RVkIxv2WfHpVPnxrqq3AuQZEd6KunI2cE1lX9IvgaJtp4zlN1K/7 F0CmQe1Z5ItbeE2TBVnF+Kt+cbrP8XVoGtwZDWaMEdrB4fk7zbJrC8TGo9wi/0PIuEdy YMWELwbLdg/8cdRtVHnZW1aBQ6fnbfpZviZpkfGGRyk8+hHETjpDLtQ539wo92x1jEgK JfuAhs/g2M27Y95rSU3nPhQFmV3uCWBrr+G5bnJpYrZgXqhnt8QQs0uSDn7h0ePbeBft Wv1Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tIGK5iXt; 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 vl9-20020a170907b60900b00718cd33f793si3566404ejc.158.2022.08.19.17.07.07; Fri, 19 Aug 2022 17:07:39 -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=tIGK5iXt; 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 S240755AbiHSXe5 (ORCPT + 99 others); Fri, 19 Aug 2022 19:34:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44320 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235036AbiHSXey (ORCPT ); Fri, 19 Aug 2022 19:34:54 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80A8DC57AC for ; Fri, 19 Aug 2022 16:34:52 -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 ams.source.kernel.org (Postfix) with ESMTPS id 30FF1B829A5 for ; Fri, 19 Aug 2022 23:34:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CB439C433C1; Fri, 19 Aug 2022 23:34:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1660952090; bh=5ezpqGMtjmIlcfSdKrdvj+9d1jz13XFCn3MQZJe3L2g=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=tIGK5iXthVEYiYngzWv9PQqoBnaTG2nDj/qhANbOUd4j19y0mree68y0HdkN6cJ0o 4+rUAuS+E1IMutJyM/UHNGy7TNQHeo6MIB0TPq8NdYzn1jmbtREOeNP2QiaxqZ3EvN paNBVrHegaFvjRNojs4n/anzpesbyRpmuuaK1LYWgynBqYZBmlfsBH8U1UaR1ij8/s n9A6VTQpuyHu7XKPdIY3p+tt1GRyJ5ycPc6ryAHwbiD1jafKiBLxIdReavl+ADBQa/ QfOpcBRw2CmNztTxrU3otHh2e9T91WpUw2fgRq/c/4WU8qoui+MXLrPnEQpXVsQVpb t8SJPiheooVLw== Date: Fri, 19 Aug 2022 16:34:48 -0700 From: Jaegeuk Kim To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Cc: stable@kernel.org Subject: Re: [PATCH v2] f2fs: fix wrong continue condition in GC Message-ID: References: <20220813143709.11909-1-jaegeuk@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220813143709.11909-1-jaegeuk@kernel.org> X-Spam-Status: No, score=-7.1 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 We should decrease the frozen counter. Cc: stable@kernel.org Fixes: 325163e9892b ("f2fs: add gc_urgent_high_remaining sysfs node") Signed-off-by: Jaegeuk Kim --- Change log from v1: - fix by refactoring the flow fs/f2fs/gc.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index 6da21d405ce1..45f90e3c46d4 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -97,14 +97,10 @@ static int gc_thread_func(void *data) */ if (sbi->gc_mode == GC_URGENT_HIGH) { spin_lock(&sbi->gc_urgent_high_lock); - if (sbi->gc_urgent_high_limited) { - if (!sbi->gc_urgent_high_remaining) { - sbi->gc_urgent_high_limited = false; - spin_unlock(&sbi->gc_urgent_high_lock); - sbi->gc_mode = GC_NORMAL; - continue; - } - sbi->gc_urgent_high_remaining--; + if (sbi->gc_urgent_high_limited && + !sbi->gc_urgent_high_remaining--) { + sbi->gc_urgent_high_limited = false; + sbi->gc_mode = GC_NORMAL; } spin_unlock(&sbi->gc_urgent_high_lock); } -- 2.37.1.595.g718a3a8f04-goog