Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp9090458rwb; Thu, 24 Nov 2022 08:00:10 -0800 (PST) X-Google-Smtp-Source: AA0mqf63NQg5I3vEy3Gs3bhzhJAQsQEVLpd0zeqGMFtBenrrWs4rkDvMi8HNrgSqLrhtel25XO9L X-Received: by 2002:aa7:c6cc:0:b0:46a:44b2:b5ed with SMTP id b12-20020aa7c6cc000000b0046a44b2b5edmr6215683eds.212.1669305610003; Thu, 24 Nov 2022 08:00:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669305609; cv=none; d=google.com; s=arc-20160816; b=WPp0DW4+RVTjTVdJ+w4e5E9JB8xTG/Rju0uFyVitOdulJLeqWajdx8y14VFSaxN286 Or98r5FoYmkj2O+zBJDa+7V5Hk+sNFOMglgP/StjNjk8ciCcAL6tr9Wx2grpzpJ178ju uOqhqgzfZDzcL+e5uLiH3t1Vv1ZDkcw45Q0hf4GaA246gSUlY1MUHwOxD3kGn13+O2sg 7ugyaS0xVotpfaSvOItsItO/QwPGmzN8nDngG6ShwPMEYNs/vGgAD9fbRThTJTxq9Y8b HY5ZfcyeIThBwzKAMgZsMEwr9Q9+YraUZU5xdQ7oDYj5y/SqNCNnFGb6p5XKykyVNxkd u5Bw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:to:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=0G3PVchfznNv9ALdeUzwL+EW6HllTQm7BxqrZeBkTwY=; b=aD739gfEesqM6JPxhp04A69bc7MTJVLQkNDTKjWH1akkYMEyrQUQOWPM/iEbs6rAKj a5lv3xfHv9+gLlUXk13KNOCV/xvYjr4P/YQhHpRxwU5v/RcZQ4B9XraZZLPZudROwIdY q5rs9eXTrwWL3mf0zrZPCB4R8UQNQFpPVBV6a+YLf2ZvmhNWyjJB5KX76BkvFa2dKDEj C+Pwlks2DStbhHdenPGBReGn8PTh7ZdwGMmnZJY+bsEihkxApwl3surdFApmOGPa8HOx hq6JFhZg9XlXMOq8f6zQAmWKqb3txPoknpdYio2/IYQgfIpmpMN0NCYG3uU3MjYaeIy0 S6Qw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AJy94VGF; 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 ft31-20020a170907801f00b007a5cdd9550esi380697ejc.201.2022.11.24.07.59.48; Thu, 24 Nov 2022 08:00:09 -0800 (PST) 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=AJy94VGF; 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 S229922AbiKXPKF (ORCPT + 86 others); Thu, 24 Nov 2022 10:10:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229786AbiKXPKD (ORCPT ); Thu, 24 Nov 2022 10:10:03 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4238C1541AB for ; Thu, 24 Nov 2022 07:10:02 -0800 (PST) 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 D03756219C for ; Thu, 24 Nov 2022 15:10:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D2ADEC433C1; Thu, 24 Nov 2022 15:09:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1669302601; bh=jy/VddZQBiwD+16FHO9sWnOOWepGfjbF8iNxZJH/hF0=; h=Date:Subject:To:References:From:In-Reply-To:From; b=AJy94VGFGikAlAAbsj96vWT9FtJtq8Cig3KLZtlS0NjGokZT35sREumWQzi3Tsc91 bp9cJbAWh5/SyFsAbazTZdrL3KCWEtcBCxiHrTp5gbMISV6wodCcyT9R9cQ4ohRmRS kQc7vKsNZnjFBt8X6RkLipHVAhhxAVSVgLe1DPwPL6+GZ2vUNGqg+pxJC/x3fXt92o gUX11vIiNToojxpDVmc+aPQ+4sbR58DvIgLoom5kJPhchi6mySNmx2bvdpLVF1GQ0/ LhBW4P91bGS9lDZhRzGg08r+/Hw3CQgAzb8Yl4WjDxOPWCDTOClQRDJHqlryQa3/r5 vvU1FEao1uxmg== Message-ID: Date: Thu, 24 Nov 2022 23:09:56 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: [RESEND][PATCH] f2fs: avoid victim selection from previous victim section Content-Language: en-US To: yonggil.song@samsung.com, "jaegeuk@kernel.org" , "linux-f2fs-devel@lists.sourceforge.net" , "linux-kernel@vger.kernel.org" References: <20221122090320epcms2p2e5df6f7bb1c2d80ae69fd5e4f84b08be@epcms2p2> From: Chao Yu In-Reply-To: <20221122090320epcms2p2e5df6f7bb1c2d80ae69fd5e4f84b08be@epcms2p2> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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,NICE_REPLY_A, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS 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 On 2022/11/22 17:03, Yonggil Song wrote: > When f2fs chooses GC victim in large section & LFS mode, > next_victim_seg[gc_type] is referenced first. After segment is freed, > next_victim_seg[gc_type] has the next segment number. > However, next_victim_seg[gc_type] still has the last segment number > even after the last segment of section is freed. In this case, when f2fs > chooses a victim for the next GC round, the last segment of previous victim > section is chosen as a victim. > > Initialize next_victim_seg[gc_type] to NULL_SEGNO for the last segment in > large section. > > Fixes: e3080b0120a1 ("f2fs: support subsectional garbage collection") > Signed-off-by: Yonggil Song Reviewed-by: Chao Yu Thanks,