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=-14.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 3668CC6377D for ; Thu, 22 Jul 2021 13:18:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1ACE461003 for ; Thu, 22 Jul 2021 13:18:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232043AbhGVMiM (ORCPT ); Thu, 22 Jul 2021 08:38:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:40362 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231925AbhGVMiK (ORCPT ); Thu, 22 Jul 2021 08:38:10 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 13F5161285; Thu, 22 Jul 2021 13:18:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1626959926; bh=bcv6IlJoNXeSdpHKVKcs8UYSOQPfqrUyXA/cjo4gCLQ=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=hpa/PlOmQWI4uX70I/rgeb4xwoQsWfZ5+S7/FELSskTu0VDMgrehUQZHQjcQjhK/z 1YW/Ai5InjBhbpPSszqaDqhKu5srzn/C2zP/T0n1ZRzWKXZSVFXTQzc01+KK4w1U+s WtPXuf78f31l3M6nFFgvTBmqSlgh+WC9uxguYKNdx31d2uiJRRyxd/jcCpeO0rLq6j 7Ua/trlfpu8yS0Eo7OTRZ24J2cuI69i9Y+19GD0IPFSo2JeGSzis2qiODsqshR2dUi Lm5KXgRIKwJH8xDl85Qsdz2mDJ71kwGO1DcEUG9EM960/oUjUhJsgTg5VWMXRcrckY UjadbOyfJ9TlQ== Subject: Re: [f2fs-dev] [PATCH v2] f2fs: fix wrong inflight page stats for directIO To: Eric Biggers Cc: jaegeuk@kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Chao Yu References: <20210719084548.25895-1-chao@kernel.org> From: Chao Yu Message-ID: <311ab257-2d67-fd73-8359-af5b44e1447c@kernel.org> Date: Thu, 22 Jul 2021 21:18:43 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021/7/22 9:42, Eric Biggers wrote: > 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? I updated the patch, could you please check that? Thanks, > > - Eric >