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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 15938C433EF for ; Tue, 1 Mar 2022 04:48:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232326AbiCAEtX (ORCPT ); Mon, 28 Feb 2022 23:49:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229588AbiCAEtV (ORCPT ); Mon, 28 Feb 2022 23:49:21 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE277AE6D for ; Mon, 28 Feb 2022 20:48:39 -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 7689E60F51 for ; Tue, 1 Mar 2022 04:48:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B6C46C340EE; Tue, 1 Mar 2022 04:48:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1646110118; bh=paui+Ittn0LWcLTmlDXTKDSrlxTU8A/9cmtrcLOsvzU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LXYTyLwc25eF6AdbUiffVQvDz6miyIC6hMPhasrrhgQkc1l4602fIdRrSXAsv0M2v 5PEnWXXbqz44rV4Hgei9tshIIu3WnaKBf+5h3lpjRksvEjja95iqiNgsK5yjPJ8Fsc 2TNvXL4hJ+ovSmJuPBdIO3Zh3EYhk/n8w0unUslnRNtLOLjj/VqB6W4l3QF0exYgO4 xKT0aUtqpLEY1om7gz8UO8fS62x9bpHDTV6P/MvPCHPCPm8KDTtX7fVFZ1Z3RQTKNv D41ib8FQ8ijYamgAERS2+TiT9JAO2tnHU0ZHhIBvbHWNgxq4eJPnd4sh/CUjA8XayD nYBjJzaJR9/tg== Date: Mon, 28 Feb 2022 20:48:37 -0800 From: Jaegeuk Kim To: Chao Yu Cc: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Subject: Re: [f2fs-dev] [PATCH v2] f2fs: avoid sb_start_intwrite during eviction Message-ID: References: <20220215220039.1477906-1-jaegeuk@kernel.org> <09683b83-b6c0-fe05-0dae-b93cab2f4b63@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 1. waiting for f2fs_evict_inode [ 5560.043945] __wait_on_freeing_inode+0xac/0xf0 [ 5560.045540] ? var_wake_function+0x30/0x30 [ 5560.047036] find_inode_fast+0x6d/0xc0 [ 5560.048473] iget_locked+0x79/0x230 [ 5560.049933] f2fs_iget+0x27/0x1200 [f2fs] [ 5560.051496] f2fs_lookup+0x18c/0x3e0 [f2fs] [ 5560.053069] __lookup_slow+0x84/0x150 [ 5560.054503] walk_component+0x141/0x1b0 [ 5560.055938] link_path_walk.part.0+0x23b/0x360 [ 5560.057541] ? end_bio_bh_io_sync+0x37/0x50 [ 5560.059086] path_parentat+0x3c/0x90 [ 5560.060492] filename_parentat+0xd7/0x1e0 [ 5560.062002] ? blk_mq_free_request+0x127/0x150 [ 5560.063576] do_renameat2+0xc1/0x5b0 --> sb_start_write(m->mnt_sb); -> __sb_start_write(sb, SB_FREEZE_WRITE); [ 5560.064999] ? __check_object_size+0x13f/0x150 [ 5560.066559] ? strncpy_from_user+0x44/0x150 [ 5560.068038] ? getname_flags.part.0+0x4c/0x1b0 [ 5560.069617] __x64_sys_renameat2+0x51/0x60 2. waiting for sb_start_intwrite -> __sb_start_write(sb, SB_FREEZE_FS); [ 5560.152447] percpu_rwsem_wait+0xaf/0x160 [ 5560.154000] ? percpu_down_write+0xd0/0xd0 [ 5560.155498] __percpu_down_read+0x4e/0x60 [ 5560.157000] f2fs_evict_inode+0x5a3/0x610 [f2fs] [ 5560.158648] ? var_wake_function+0x30/0x30 [ 5560.160341] evict+0xd2/0x180 [ 5560.161728] prune_icache_sb+0x81/0xb0 --> inode_lru_isolate() -> inode->i_state |= I_FREEING; [ 5560.163179] super_cache_scan+0x169/0x1f0 [ 5560.164675] do_shrink_slab+0x145/0x2b0 [ 5560.166121] shrink_slab+0x186/0x2d0 [ 5560.167481] drop_slab_node+0x4a/0x90 [ 5560.168876] drop_slab+0x3e/0x80 [ 5560.170178] drop_caches_sysctl_handler+0x75/0x90 [ 5560.171761] proc_sys_call_handler+0x149/0x280 [ 5560.173328] proc_sys_write+0x13/0x20 [ 5560.174667] new_sync_write+0x117/0x1b0 [ 5560.176120] vfs_write+0x1d5/0x270 [ 5560.177409] ksys_write+0x67/0xe0 Signed-off-by: Jaegeuk Kim --- Note, I found this call stack. fs/f2fs/inode.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c index ab8e0c06c78c..882db4bd917b 100644 --- a/fs/f2fs/inode.c +++ b/fs/f2fs/inode.c @@ -778,7 +778,6 @@ void f2fs_evict_inode(struct inode *inode) f2fs_remove_ino_entry(sbi, inode->i_ino, UPDATE_INO); f2fs_remove_ino_entry(sbi, inode->i_ino, FLUSH_INO); - sb_start_intwrite(inode->i_sb); set_inode_flag(inode, FI_NO_ALLOC); i_size_write(inode, 0); retry: @@ -809,7 +808,6 @@ void f2fs_evict_inode(struct inode *inode) if (dquot_initialize_needed(inode)) set_sbi_flag(sbi, SBI_QUOTA_NEED_REPAIR); } - sb_end_intwrite(inode->i_sb); no_delete: dquot_drop(inode); -- 2.35.1.574.g5d30c73bfb-goog 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 ADD06C433F5 for ; Tue, 1 Mar 2022 04:48:55 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.94.2) (envelope-from ) id 1nOuRS-0006HA-Q5; Tue, 01 Mar 2022 04:48:53 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1nOuRR-0006H4-17 for linux-f2fs-devel@lists.sourceforge.net; Tue, 01 Mar 2022 04:48:51 +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=6i08bcoqm3uwPdBWparKuGLVWtVIx57w3igE9ayinUo=; b=Nxr5Qd+XgEbl0WnwmdMBwvAp1z 6qNObspTdvtO/gsXLhZUQ7wX8LE5DGrJ7Yy/SCF6lHxmeMRaAAxFctwLN8t2NmIzl4ge7NZE1Vugz oEUr7rcfYH8GhQmNOERaJ4bOHfisj0MFl4oAoQ61VANpiD1wU6aOIGWLLV5oms5hS0hc=; 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=6i08bcoqm3uwPdBWparKuGLVWtVIx57w3igE9ayinUo=; b=LQo4G9ZApUL30h7ZzRJpK/hQWp vMboiVZ1zJG3pJCj/QkF2BP9gLy8HzfEwktxNerLVvL4tBlySgvOkL4QmIa3BaK/rqN2QUg/h0amm LCJFbGv5RT3i/gDibsa6UhdttJXFkT3hoeUQOTVmzcz2xZXxZC0jES+4LslZufOuGt/U=; 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.94.2) id 1nOuRN-0003CK-1U for linux-f2fs-devel@lists.sourceforge.net; Tue, 01 Mar 2022 04:48:51 +0000 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 6B82560F38 for ; Tue, 1 Mar 2022 04:48:39 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B6C46C340EE; Tue, 1 Mar 2022 04:48:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1646110118; bh=paui+Ittn0LWcLTmlDXTKDSrlxTU8A/9cmtrcLOsvzU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LXYTyLwc25eF6AdbUiffVQvDz6miyIC6hMPhasrrhgQkc1l4602fIdRrSXAsv0M2v 5PEnWXXbqz44rV4Hgei9tshIIu3WnaKBf+5h3lpjRksvEjja95iqiNgsK5yjPJ8Fsc 2TNvXL4hJ+ovSmJuPBdIO3Zh3EYhk/n8w0unUslnRNtLOLjj/VqB6W4l3QF0exYgO4 xKT0aUtqpLEY1om7gz8UO8fS62x9bpHDTV6P/MvPCHPCPm8KDTtX7fVFZ1Z3RQTKNv D41ib8FQ8ijYamgAERS2+TiT9JAO2tnHU0ZHhIBvbHWNgxq4eJPnd4sh/CUjA8XayD nYBjJzaJR9/tg== Date: Mon, 28 Feb 2022 20:48:37 -0800 From: Jaegeuk Kim To: Chao Yu Message-ID: References: <20220215220039.1477906-1-jaegeuk@kernel.org> <09683b83-b6c0-fe05-0dae-b93cab2f4b63@kernel.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-Headers-End: 1nOuRN-0003CK-1U Subject: Re: [f2fs-dev] [PATCH v2] f2fs: avoid sb_start_intwrite during eviction 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 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net 1. waiting for f2fs_evict_inode [ 5560.043945] __wait_on_freeing_inode+0xac/0xf0 [ 5560.045540] ? var_wake_function+0x30/0x30 [ 5560.047036] find_inode_fast+0x6d/0xc0 [ 5560.048473] iget_locked+0x79/0x230 [ 5560.049933] f2fs_iget+0x27/0x1200 [f2fs] [ 5560.051496] f2fs_lookup+0x18c/0x3e0 [f2fs] [ 5560.053069] __lookup_slow+0x84/0x150 [ 5560.054503] walk_component+0x141/0x1b0 [ 5560.055938] link_path_walk.part.0+0x23b/0x360 [ 5560.057541] ? end_bio_bh_io_sync+0x37/0x50 [ 5560.059086] path_parentat+0x3c/0x90 [ 5560.060492] filename_parentat+0xd7/0x1e0 [ 5560.062002] ? blk_mq_free_request+0x127/0x150 [ 5560.063576] do_renameat2+0xc1/0x5b0 --> sb_start_write(m->mnt_sb); -> __sb_start_write(sb, SB_FREEZE_WRITE); [ 5560.064999] ? __check_object_size+0x13f/0x150 [ 5560.066559] ? strncpy_from_user+0x44/0x150 [ 5560.068038] ? getname_flags.part.0+0x4c/0x1b0 [ 5560.069617] __x64_sys_renameat2+0x51/0x60 2. waiting for sb_start_intwrite -> __sb_start_write(sb, SB_FREEZE_FS); [ 5560.152447] percpu_rwsem_wait+0xaf/0x160 [ 5560.154000] ? percpu_down_write+0xd0/0xd0 [ 5560.155498] __percpu_down_read+0x4e/0x60 [ 5560.157000] f2fs_evict_inode+0x5a3/0x610 [f2fs] [ 5560.158648] ? var_wake_function+0x30/0x30 [ 5560.160341] evict+0xd2/0x180 [ 5560.161728] prune_icache_sb+0x81/0xb0 --> inode_lru_isolate() -> inode->i_state |= I_FREEING; [ 5560.163179] super_cache_scan+0x169/0x1f0 [ 5560.164675] do_shrink_slab+0x145/0x2b0 [ 5560.166121] shrink_slab+0x186/0x2d0 [ 5560.167481] drop_slab_node+0x4a/0x90 [ 5560.168876] drop_slab+0x3e/0x80 [ 5560.170178] drop_caches_sysctl_handler+0x75/0x90 [ 5560.171761] proc_sys_call_handler+0x149/0x280 [ 5560.173328] proc_sys_write+0x13/0x20 [ 5560.174667] new_sync_write+0x117/0x1b0 [ 5560.176120] vfs_write+0x1d5/0x270 [ 5560.177409] ksys_write+0x67/0xe0 Signed-off-by: Jaegeuk Kim --- Note, I found this call stack. fs/f2fs/inode.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/fs/f2fs/inode.c b/fs/f2fs/inode.c index ab8e0c06c78c..882db4bd917b 100644 --- a/fs/f2fs/inode.c +++ b/fs/f2fs/inode.c @@ -778,7 +778,6 @@ void f2fs_evict_inode(struct inode *inode) f2fs_remove_ino_entry(sbi, inode->i_ino, UPDATE_INO); f2fs_remove_ino_entry(sbi, inode->i_ino, FLUSH_INO); - sb_start_intwrite(inode->i_sb); set_inode_flag(inode, FI_NO_ALLOC); i_size_write(inode, 0); retry: @@ -809,7 +808,6 @@ void f2fs_evict_inode(struct inode *inode) if (dquot_initialize_needed(inode)) set_sbi_flag(sbi, SBI_QUOTA_NEED_REPAIR); } - sb_end_intwrite(inode->i_sb); no_delete: dquot_drop(inode); -- 2.35.1.574.g5d30c73bfb-goog _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel