Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp1706843pxb; Wed, 9 Feb 2022 02:44:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJwSTQctndk19/Tnid0s6g0j9Mn1uZ5XcWvbMUZYxUc/kwBP6D2Ua806UGX7z0sQrbC5MdiN X-Received: by 2002:a63:18e:: with SMTP id 136mr1391194pgb.478.1644403470893; Wed, 09 Feb 2022 02:44:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644403470; cv=none; d=google.com; s=arc-20160816; b=t8ADg8rPD0/GVBHnvFf732NSBgwST/tssChusE3aXvbpCutY98RZfed9YnlpVOG799 qv28OQRdqVgAVAxLQrvj5CdCRE3UKIVUU/3QQtZ/OminPVRJRN8SE1xZXP9VggjS/Kh1 q8CygRy0Tm/S2dmKan7xsCIoxvPF0MD+uQ7MiZmoZbAnYd86fBYdMSI/bfsH2p1FdOGG zEcKCRsd/C7+Sk3Q+NnG5t2cHsxTlmtpMMkY+Od2HF7Yz/GtwNGx7+e3ZrnpNCN3D3Zy harmlCCrPEzwc6cLnr83hjQzAlILKO0SksLcZPnq0x/5wAgduQl0F+jz7zMe/abbyNfV NZig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=rBhSciC5pp7GHVHF13cKYldZEIeEVVixoZyuc/RgctU=; b=gLOXZdYXdkvJwKntl9B6g/NZdA/SN1x1/NQNfRb/ZxNDemSahMnRTcNRgFUtHndQJv v2EMZR6y49i5zM6Wafmir4O5U0ura0mJxypBlm/NtIzQN6I1Vbyw9eEd9gFJUxzK6Vyi d63d0RcdLjTFtkdKpSCr6bMJ7YuS1s2eGVO8s/NZzdxnPq5EYQwM10Lm4eZkHPOQ2zxW nlIf/0QT139DKNQ+jvseDAwKj4PE1ocWw8Dylnb8Mc2kKQNmuk3Rl6T/0wWlYcPBASAw 3c4Xdc6Lknhy9LQ/HTiCsLy2l0kIThR1IHal500vnqg36ZsY/bL1VKjSx4HdsE1/t7Vi sIJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mtOs0UFv; 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 z5si1677167plg.361.2022.02.09.02.44.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 02:44:30 -0800 (PST) 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=mtOs0UFv; 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 2FA66E0B1FC1; Wed, 9 Feb 2022 01:25:34 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238883AbiBGTSz (ORCPT + 99 others); Mon, 7 Feb 2022 14:18:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45984 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239313AbiBGTOz (ORCPT ); Mon, 7 Feb 2022 14:14:55 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00921C0401DC for ; Mon, 7 Feb 2022 11:14:54 -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 ams.source.kernel.org (Postfix) with ESMTPS id AB551B80EF6 for ; Mon, 7 Feb 2022 19:14:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 440D8C004E1; Mon, 7 Feb 2022 19:14:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1644261292; bh=HJoLZayjw9d/gTYyeZLWOIyycJnicgl+gCOYbWkZsXU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=mtOs0UFvLFkypBmJJ4xlwyKBYH+C3cuBhr2TXU4kpDV9+q1LF8W1t++Gwl4Ejy9// xbD6K6t+PhFRAo0E9bK7c63F1EadKKIfN678kYPxoxlCKz/M++a5b1hdQU6q56lPQf A/G+HyzTi+1QQoBU0/VhUOx3ja68Klh4Yx9BHryHm6RE99SZvhzVQ9aS0ED7pwNVYA LAaA67j2ip7+Oop90XwqyRjxNe6N3/HPmvLTj94CBSZ/tXh8BjuGhhrIB1oeliy/TT 6D3quwBsbKKrzomk2Lf/xp41Lbm0i4EB4eth6qu7VpDbCL+xHcS7N/N3jdZFEhjALr 7BZMFQ5tFiuSA== Date: Mon, 7 Feb 2022 11:14:50 -0800 From: Jaegeuk Kim To: Chao Yu Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: Re: [PATCH] f2fs: avoid unneeded preflush during checkpoint() Message-ID: References: <20220207113516.9489-1-chao@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220207113516.9489-1-chao@kernel.org> X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, 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 02/07, Chao Yu wrote: > During checkpoint, we have committed preflush command via f2fs_flush_device_cache() 787 int f2fs_flush_device_cache(struct f2fs_sb_info *sbi) 788 { 789 int ret = 0, i; 790 791 if (!f2fs_is_multi_device(sbi)) 792 return 0; Seems a wrong assumption. > to persist all metadata pages except last #2 CP pack page, so we don't need to > commit another preflush command in commit_checkpoint(), remove it to avoid unneeded > write cache overhead. > > Signed-off-by: Chao Yu > --- > fs/f2fs/data.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c > index 8c417864c66a..15ac18bbbc8e 100644 > --- a/fs/f2fs/data.c > +++ b/fs/f2fs/data.c > @@ -598,7 +598,7 @@ static void __f2fs_submit_merged_write(struct f2fs_sb_info *sbi, > io->fio.op = REQ_OP_WRITE; > io->fio.op_flags = REQ_META | REQ_PRIO | REQ_SYNC; > if (!test_opt(sbi, NOBARRIER)) > - io->fio.op_flags |= REQ_PREFLUSH | REQ_FUA; > + io->fio.op_flags |= REQ_FUA; > } > __submit_merged_bio(io); > up_write(&io->io_rwsem); > -- > 2.32.0