From mboxrd@z Thu Jan 1 00:00:00 1970 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 D28D9C71153 for ; Mon, 4 Sep 2023 16:40:48 +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 1qdCd3-0004LX-36; Mon, 04 Sep 2023 16:40:46 +0000 Received: from [172.30.20.202] (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 1qdCd1-0004LR-KV for linux-f2fs-devel@lists.sourceforge.net; Mon, 04 Sep 2023 16:40:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=In-Reply-To:Content-Type:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding: 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=rLmavJmKst8MwlRCpvYzryPGqmmeFR2AewgneG0z5Bs=; b=WWe/9AUXseyOHr3c6kfpyyd1yr icWkQRp01J5Io/YrdQyRcUuZcTIDWIor2whcyqhtEN0ty0+R6zEer4ga7seWIlHLhgh3+ZO+TYYc7 FW3Xh2fGALSiBcjW4PWoTo6DeaNpMivnbYz1oeIkG+DQL4V6OLuRdoQtCo+1YOXU+XFM=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To :From:Date:Sender:Reply-To:Content-Transfer-Encoding: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=rLmavJmKst8MwlRCpvYzryPGqmmeFR2AewgneG0z5Bs=; b=FrNYb0fB/wjbfacI6kHic8r2Ip 9cFxHFj186gCtUCvqZ3I7sHQ2pG0TXaOKC5wupUVo2J1E6gXoi7+jzn7vWpXI7DJ/uxtDOn8Ftejr +EgdePGkjY6lBXxxBy8Qw+K867Qku77dyopy+4p1bC/JApMaO7GhoSweU6oO7kRalumM=; 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 1qdCcy-0003rj-E2 for linux-f2fs-devel@lists.sourceforge.net; Mon, 04 Sep 2023 16:40:44 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 40D1260EDE; Mon, 4 Sep 2023 16:40:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 857D6C433C8; Mon, 4 Sep 2023 16:40:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1693845632; bh=3xgIBlBK1m7Zp9mLlRF22BaIUy8HKmcr8AoobM9e/dM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=KBMDbz4uHiM3Eij5T6Y3avqcmevmnQMOGFB8RuIvWI4tmD5wqCudMFYvhxbFhMyMc gwXM6ex64ixHUfiD3ns6AzKvqj3UjflxLCRjY0eOU63EaqFWayJgOdw8FKXTho7lGK sOgP0+AxDFIjfteO0jnfHAfwVKwYne7Ma3Ba+8GyKZlfLGzvI5Qi6zOflfFw3N87Ko AgSKU+I5YJMqaEllCxbklIe/9qksg+EuuT2t8XMBptlpAkgOrhsSYc0JEwPahBp7ZH OZBWUjN3vAoFshEVo09g3oDm4plAXgbfJWQYosczYPmxwSdn5KxNxMG2RZvz2/GNxP dQO8MEPbKikyA== Date: Mon, 4 Sep 2023 09:40:30 -0700 From: Jaegeuk Kim To: Chao Yu Message-ID: References: <20230831071011.56116-1-guochunhai@vivo.com> <0749d51f-bbc3-dfcb-93e3-c6c34614f403@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <0749d51f-bbc3-dfcb-93e3-c6c34614f403@kernel.org> X-Headers-End: 1qdCcy-0003rj-E2 Subject: Re: [f2fs-dev] [PATCH v2] f2fs: replace blk_finish_plug() with blk_flush_plug() 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: Chunhai Guo , linux-f2fs-devel@lists.sourceforge.net Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net On 09/04, Chao Yu wrote: > On 2023/8/31 15:10, Chunhai Guo wrote: > > The commit 344150999b7f ("f2fs: fix to avoid potential deadlock") only > > requires unplugging current->plug. Using blk_finish_plug() is unnecessary > > as it sets current->plug as NULL and prevents wb_writeback() from using > > plug in subsequent loops. Instead, use blk_flush_plug() as a replacement. > > > > Signed-off-by: Chunhai Guo > > --- > > fs/f2fs/data.c | 3 +-- > > fs/f2fs/node.c | 3 +-- > > 2 files changed, 2 insertions(+), 4 deletions(-) > > > > diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c > > index 916e317ac925..77b4a55d6d94 100644 > > --- a/fs/f2fs/data.c > > +++ b/fs/f2fs/data.c > > @@ -3346,8 +3346,7 @@ static int __f2fs_write_data_pages(struct address_space *mapping, > > atomic_inc(&sbi->wb_sync_req[DATA]); > > else if (atomic_read(&sbi->wb_sync_req[DATA])) { > > /* to avoid potential deadlock */ > > - if (current->plug) > > - blk_finish_plug(current->plug); > > What about? > > if (current->plug) { > struct blk_plug *plug = current->plug; > > blk_finish_plug(plug); > blk_start_plug(plug); > } > > Jaegeuk, thoughts? By the way, do we really need to reuse current->plug again? After checkpoint being done, we can use the plug in __f2fs_write_data_pages. Are there some numbers to show the benefit? > > Thanks, > > > + blk_flush_plug(current->plug, false); > > goto skip_write; > > } > > diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c > > index ee2e1dd64f25..c4b5717a8c1a 100644 > > --- a/fs/f2fs/node.c > > +++ b/fs/f2fs/node.c > > @@ -2126,8 +2126,7 @@ static int f2fs_write_node_pages(struct address_space *mapping, > > atomic_inc(&sbi->wb_sync_req[NODE]); > > else if (atomic_read(&sbi->wb_sync_req[NODE])) { > > /* to avoid potential deadlock */ > > - if (current->plug) > > - blk_finish_plug(current->plug); > > + blk_flush_plug(current->plug, false); > > goto skip_write; > > } _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel