From patchwork Thu Jun 6 09:52:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chao Yu X-Patchwork-Id: 13688215 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 8632DC25B75 for ; Thu, 6 Jun 2024 09:52:40 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-1.v29.lw.sourceforge.com) by sfs-ml-1.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1sF9nS-0000z0-Lb; Thu, 06 Jun 2024 09:52:39 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-1.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1sF9nQ-0000yq-Kd for linux-f2fs-devel@lists.sourceforge.net; Thu, 06 Jun 2024 09:52:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:References: In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=0Qtit0s+ubEdwb2l1dDcIyvlNhAk3ps4t2tuYcweImE=; b=Ma6/fwXhy7UvrJsQioIWJvKaCN NFSocfuiYQPXHlrO+fQvSVskUeHk8sARW/Iu0EcqLH7uwrT1p5gmU1F81tdgfuZ9FC53M0PaFG5gt DtJNhq8PHBGiqhNGPVpOSUagQ9TQwt0QJaP6KhK068wWq4avJuQCsHjgbCnuJ03DbAKE=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id: Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=0Qtit0s+ubEdwb2l1dDcIyvlNhAk3ps4t2tuYcweImE=; b=SRB534L+ieVWlHE5gnXlBnhwct 972bc5gdZfEc2NX1lv2/EjglbDeh1iu5bDSYfA2Ag57yc++NbO4moFYgVYhbN3GwTx/OH6/J+jeTB jZVlcb+AI+r8Wuxe0e/mp4R+ruTo0/rRbUft6hR/vrVR9bnvNfkJnEobDp1pZzdfhptQ=; Received: from dfw.source.kernel.org ([139.178.84.217]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1sF9nS-0004OY-0r for linux-f2fs-devel@lists.sourceforge.net; Thu, 06 Jun 2024 09:52:37 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id E340461A14 for ; Thu, 6 Jun 2024 09:52:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 92FD0C4AF0D; Thu, 6 Jun 2024 09:52:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717667546; bh=1A4x52edkxk15o++tyYBiiibRgkm7p/CeiPX3AK72eo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oV1szKEXx6PIDhSbDwjHlwMXPTlD3x5MY2IXcNWWkyCBSwTAi4TTEqjoO82yl/M3V wexutYQvf6Us0ZnAb3IVk5F0DOHvq/HHBJc3K0nqvJ8R4Ls3xScHAUNMQEt00vBuTO qJ8zEjiMTFZVKYGKoFBPDM7j19NjNhiCuXhjhLhOctvqM/mVCxdHgNkgi4rV8B/dV1 wpQ+PC1TYhkRcOFGap0X9agTgBsi7kcRlDcGw1vRCmssuziSfF06JYLnwrHny7C1aM 6cIF2Ta+qHN05PRw+eXQvw+ZrzNCmalA1PDUvlbwc1Qt0Wu7h5yRQSw43g21/b7rOK 73qjGvTanl74w== From: Chao Yu To: jaegeuk@kernel.org Date: Thu, 6 Jun 2024 17:52:13 +0800 Message-Id: <20240606095213.4087668-2-chao@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240606095213.4087668-1-chao@kernel.org> References: <20240606095213.4087668-1-chao@kernel.org> MIME-Version: 1.0 X-Headers-End: 1sF9nS-0004OY-0r Subject: [f2fs-dev] [PATCH 2/2] f2fs: fix to use sb_{start, end}_intwrite{_trylock, }() in gc_thread_func() X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net Since background GC is f2fs inner operation, so, let's use sb_{start,end}_intwrite{_trylock,}() instead of sb_{start,end}_write{_trylock,}() in gc_thread_func(). Signed-off-by: Chao Yu --- 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 ef667fec9a12..004587ac5530 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -76,7 +76,7 @@ static int gc_thread_func(void *data) f2fs_stop_checkpoint(sbi, false, STOP_CP_REASON_FAULT_INJECT); - if (!sb_start_write_trylock(sbi->sb)) { + if (!sb_start_intwrite_trylock(sbi->sb)) { stat_other_skip_bggc_count(sbi); continue; } @@ -163,7 +163,7 @@ static int gc_thread_func(void *data) } spin_unlock(&sbi->gc_remaining_trials_lock); } - sb_end_write(sbi->sb); + sb_end_intwrite(sbi->sb); } while (!kthread_should_stop()); return 0;