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 X-Spam-Level: X-Spam-Status: No, score=-12.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8A8B9C6377B for ; Thu, 22 Jul 2021 01:42:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7029461261 for ; Thu, 22 Jul 2021 01:42:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230268AbhGVBCQ (ORCPT ); Wed, 21 Jul 2021 21:02:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:59382 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229868AbhGVBCP (ORCPT ); Wed, 21 Jul 2021 21:02:15 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 72D8F60FDB; Thu, 22 Jul 2021 01:42:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626918171; bh=Y2xTwQc6YUfESJt0St8gmjwX+3UIJoeNHUkqBbZj8n8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=b2gf1zVUCuVjVzKkm8L3v+N3ou/SDemhBhKk1skdhgMpRmfWiZnfcmb2XyNHo8p2Z 4GuPI8gTKCfbRdSHaFEKtrf9NRZQ/QUrS+GoCHR5I+rjVNSLn+CeHGW7b5mZhNzMTL wAqEFwtnhX/U64HKeH5YOEjoy4ML9eO3QOs2AGeMqNChz3Ba9ufLSDXA31vscPCWa5 HEmcE1cChWgQCMLAuvBtyaEo56KUYpVnm4hQJpw4I3WQMqD7f329rcQ9V9cCu+KjQG 0HmueBdH5FmHF6tKxuEE009snZqkyGs7UhA93anhKdiAOuXvjKnSnOqdZ83mrqgrvm XgppLKrhFWwag== Date: Wed, 21 Jul 2021 18:42:50 -0700 From: Eric Biggers To: Chao Yu Cc: jaegeuk@kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Chao Yu Subject: Re: [f2fs-dev] [PATCH v2] f2fs: fix wrong inflight page stats for directIO Message-ID: References: <20210719084548.25895-1-chao@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 On Wed, Jul 21, 2021 at 05:46:26PM -0700, Eric Biggers wrote: > On Mon, Jul 19, 2021 at 04:45:48PM +0800, Chao Yu wrote: > > Previously, we use sbi->nr_pages[] to account direct IO, the count should > > be based on page granularity rather than bio granularity, fix it. > > > > Fixes: 02b16d0a34a1 ("f2fs: add to account direct IO") > > Signed-off-by: Chao Yu Also, do we have to do this, as opposed to just moving F2FS_DIO_WRITE and F2FS_DIO_READ out of ->nr_pages[] and into separate counters that are clearly defined to be per-request? As Christoph pointed out (https://lkml.kernel.org/r/YPU+3inGclUtcSpJ@infradead.org), these counters are only used to check whether there is any in-flight direct I/O at all. (They're also shown in /sys/kernel/debug/f2fs/status, but that doesn't really matter.) As Christoph mentioned, there is a way to avoid needing f2fs_dio_submit_bio() (which would save a memory allocation for every bio, which can fail). But it will only work if the counters remain per-request. Can we leave these as per-request? - Eric