Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4694749iob; Sun, 8 May 2022 22:17:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLwyR3Vzp8Q2RM9HsEnuPkjen5eDoMyYljvKjfRtXDhhwg+VWm3luUiqoB7ZMUTxs6z9e7 X-Received: by 2002:a05:6a00:17a3:b0:50e:b37:c52 with SMTP id s35-20020a056a0017a300b0050e0b370c52mr14659464pfg.25.1652073439699; Sun, 08 May 2022 22:17:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652073439; cv=none; d=google.com; s=arc-20160816; b=lnrJaJdy+ftRGSTVH8UjYVrL5M8N7tT3iDmJ8nMwTmJVEnJaI5sT4EPyAX2/qxzaDC h1UdsNQZWSwgJ7ewTw6EVDVGT+lxWiwQ0eJnPzPhwF0oEAiCT7N3WS/oYPLIM6t0kjeu iPrjx8qkoDG84If303OuGyQgtILELAKittv3epPaxR8JQrTmM5OdCNF2iyssarPwFpSI ksHayBqUoRcV1Yd1RpWfCGKiLmR+nOz9+CaovLZrEzq0f24ksoXrqrf2TCXJKRRyrPHK Ew+GirawQedxA/4T+aUVXdTb6UyetjCAhtrd3teJEZIHu+fhcTiHaJ39v+K4+xXe+Xrb lyVA== 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=pkj4h1N5vUw3ptwUNxt5tmuIW/mBf6Cvd1BuowRIVCM=; b=JuPPzvuXMULsFtwlEymbVWY9rjrp4gVBVLRvSHoUjsuG8NiDMzms0JANnZ13fyrjwa nEJvUbRjiLq0dakXMoIHpTSP5eLbwXBXzQ9koQiH1FNv2KQpwMBZX0TKICyG+6Gq0hzX 7CSwhvTGz4Y73CxDG1Kn9Ns/fppFBCO46HvCiYNwfhrE1yxtuEwWZ/O8EAykmDi0NZFl SRU9GJ6PdvVarhqXOksK/9CeTPZGLCEsrNoeQSW3//7rExOZJYHbC6ooALlm8XQMf/hv 4v8IKVM53ETM+Y14QMC8FHxPdQNBGV1MiOJk3B2OiBJ5C3kpW8G2oVvG+9H4fZZVLA57 Finw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kJ46Gd53; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id oc13-20020a17090b1c0d00b001d923712bcbsi13179955pjb.29.2022.05.08.22.17.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 08 May 2022 22:17:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=kJ46Gd53; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 0BF74144B36; Sun, 8 May 2022 22:13:19 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234010AbiEHOpL (ORCPT + 99 others); Sun, 8 May 2022 10:45:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229689AbiEHOpJ (ORCPT ); Sun, 8 May 2022 10:45:09 -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 E1604E0E9 for ; Sun, 8 May 2022 07:41:18 -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 81FC1611BC for ; Sun, 8 May 2022 14:41:18 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0A9C7C385A4; Sun, 8 May 2022 14:41:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1652020877; bh=t8HXZdI0ta/IUuWc1jQys+uGfSMD6nMCvKG+hO+WBPM=; h=Date:Subject:To:References:From:In-Reply-To:From; b=kJ46Gd53tCLywcEn4kCqDiiuLMTMC6Uoaq1aF9x+umUYyVUCxl5X7uG+g/IMEtJw+ /VupFsaSTJI5s1SgnEkEl1eFERtDEeKWWitjL0+bsM6Gd2nmxTNrZ84RAtFhAc2iJS EmTxaA9fP40nE7NzB1vDtyZOkuwAThuI032kF3RtLT9ctTkXfdI58N/yZOh/C+FUi/ CBXh2WdM7I4RXHBsWXhlaS3tIlx76w7+fAfshQK45xbBO2lf5zMKfom2W7kWvUbwuE JP5EQZbWSMLmgYrVeG/TeCdyTMp3VN8Zd8PVji01vxsDjg5yGWB0WkIEpKvysgRG+I 2qn0dKGiBem7g== Message-ID: Date: Sun, 8 May 2022 22:41:14 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [f2fs-dev] [PATCH 3/5] f2fs: keep wait_ms if EAGAIN happens Content-Language: en-US To: Jaegeuk Kim , linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net References: <20220506232032.1264078-1-jaegeuk@kernel.org> <20220506232032.1264078-3-jaegeuk@kernel.org> From: Chao Yu In-Reply-To: <20220506232032.1264078-3-jaegeuk@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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/5/7 7:20, Jaegeuk Kim wrote: > In f2fs_gc thread, let's keep wait_ms when sec_freed was zero. sec_freed won't increase for background GC due to below statement: if (gc_type == FG_GC && get_valid_blocks(sbi, segno, false) == 0) seg_freed++; It may cause gc thread migrates lots of segments in each round? Thanks, > > Signed-off-by: Jaegeuk Kim > --- > fs/f2fs/gc.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c > index aeffcc1d5c02..ec3f6f876e76 100644 > --- a/fs/f2fs/gc.c > +++ b/fs/f2fs/gc.c > @@ -37,7 +37,8 @@ static int gc_thread_func(void *data) > unsigned int wait_ms; > struct f2fs_gc_control gc_control = { > .victim_segno = NULL_SEGNO, > - .should_migrate_blocks = false }; > + .should_migrate_blocks = false, > + .err_gc_skipped = false }; > > wait_ms = gc_th->min_sleep_time; > > @@ -146,7 +147,6 @@ static int gc_thread_func(void *data) > > gc_control.init_gc_type = sync_mode ? FG_GC : BG_GC; > gc_control.no_bg_gc = foreground; > - gc_control.err_gc_skipped = sync_mode; > > /* if return value is not zero, no victim was selected */ > if (f2fs_gc(sbi, &gc_control))