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 AB62DEB64D7 for ; Tue, 13 Jun 2023 20:40:07 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1q9Ao7-0000FB-HW; Tue, 13 Jun 2023 20:40:03 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1q9Ao6-0000F5-V3 for linux-f2fs-devel@lists.sourceforge.net; Tue, 13 Jun 2023 20:40:03 +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: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:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=HYEPHnKJZJwBllOOaE+wWwPcndapSn+SEdVnQ29R52I=; b=AuXfqGUJELKiQQyeLNm3yQocOh zEX0rf7zKQv9AyD3pzVHo2+5wb27WF9rXmzcwP6qF+YNqMw2OhHIzXGw+p/apzZYqE6ytogByGSJa tPmKQlp5PxVHr86iWq8AlaI+MgE3rrXcp7H45lbxOJ6xfyuVJGKw4qD8csipinfOnqLg=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version: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:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=HYEPHnKJZJwBllOOaE+wWwPcndapSn+SEdVnQ29R52I=; b=X JARBLLybYt7q78q//X/jBBNUV/WhgQ82PX343Mdy7QHHaOlv3fGWrGC37sWRzSQLWP7mhIl84EqCV X0VQjQeUq+g7K0ioc+NPUgY8a9pWBSuaNEnmbo3D2lP2FP/LOUfgjNgwi6BRN85gnR3DNw4YbNsyJ CPqebeB7uVYh9OB0=; Received: from dfw.source.kernel.org ([139.178.84.217]) by sfi-mx-1.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1q9Ao3-0029rY-1Q for linux-f2fs-devel@lists.sourceforge.net; Tue, 13 Jun 2023 20:40:03 +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 3BAD4615A7 for ; Tue, 13 Jun 2023 20:39:50 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 910F0C433C0; Tue, 13 Jun 2023 20:39:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1686688789; bh=sLZ+P360Imf7bwyICslM2xpcRXFrq+wunkzXqiYuC6c=; h=From:To:Cc:Subject:Date:From; b=nZ9YV6tj3Y7La98xNEpw85oJMLL0gU6jsgf/cp7ApkpVAIGvgK6noVqsGG3xyy9Gu qcoPD2tHLvUPYABIyRfS7fHlQU9EEILPo0vYwdBWx2sCCWEkQIZjcMJNFeO9eqj2sP 73Qo3VEL0dr2ed1HPLZUgIVLNeAkLCRKj6dvVtchxtkHTNfnyn/IcY4u0gsI8qel8k mS5CKjoi8WAUQYkx8m7mDD1zIOMl6B8vDuaCeRRLrF38IBPr/da4aC7HQuA16C5rtS CkWfC0E0PkN0djNLLccF3WAUuZXccRiDUJ05GJ4hhRaHyhA3miYfEQE1/sg5rX/Vsi smDV0j5ZU5Vxw== From: Jaegeuk Kim To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Date: Tue, 13 Jun 2023 13:39:47 -0700 Message-ID: <20230613203947.2745943-1-jaegeuk@kernel.org> X-Mailer: git-send-email 2.41.0.162.gfafddb0af9-goog MIME-Version: 1.0 X-Headers-End: 1q9Ao3-0029rY-1Q Subject: [f2fs-dev] [PATCH] f2fs: do not issue small discard commands during checkpoint 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: Jaegeuk Kim Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net If there're huge # of small discards, this will increase checkpoint latency insanely. Let's issue small discards only by trim. Signed-off-by: Jaegeuk Kim --- fs/f2fs/segment.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 0c0c033c4bdd..ef46bb085385 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -2178,7 +2178,7 @@ void f2fs_clear_prefree_segments(struct f2fs_sb_info *sbi, } mutex_unlock(&dirty_i->seglist_lock); - if (!f2fs_block_unit_discard(sbi)) + if (!f2fs_block_unit_discard(sbi) || !force) goto wakeup; /* send small discards */ @@ -2192,8 +2192,7 @@ void f2fs_clear_prefree_segments(struct f2fs_sb_info *sbi, sbi->blocks_per_seg, cur_pos); len = next_pos - cur_pos; - if (f2fs_sb_has_blkzoned(sbi) || - (force && len < cpc->trim_minlen)) + if (f2fs_sb_has_blkzoned(sbi) || len < cpc->trim_minlen) goto skip; f2fs_issue_discard(sbi, entry->start_blkaddr + cur_pos, -- 2.41.0.162.gfafddb0af9-goog _______________________________________________ Linux-f2fs-devel mailing list Linux-f2fs-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel