From: Guoqing Jiang <jgq516@gmail.com>
To: Christoph Hellwig <hch@infradead.org>, Song Liu <song@kernel.org>
Cc: Artur Paszkiewicz <artur.paszkiewicz@intel.com>,
linux-raid <linux-raid@vger.kernel.org>,
linux-block@vger.kernel.org,
Pawe?? Wiejacha <pawel.wiejacha@rtbhouse.com>
Subject: Re: [PATCH] md: don't account io stat for split bio
Date: Thu, 13 May 2021 15:24:27 +0800 [thread overview]
Message-ID: <5e91dccb-31f3-daa0-f974-9c3211cc6b15@gmail.com> (raw)
In-Reply-To: <YJot2JAZkQi7RPGS@infradead.org>
On 5/11/21 3:10 PM, Christoph Hellwig wrote:
> On Mon, May 10, 2021 at 11:58:32PM -0700, Song Liu wrote:
>> IIUC, the sysfs node is needed to get better performance (by disabling
>> accounting)?
> FYI, we already have that sysfs file in the block layer
> ("queue/iostats"), please just observe QUEUE_FLAG_IO_STAT flag.
Seems only nvdimm observe the flag before call bio_{start,end}_io_acct.
Does it make sense to make the checking mandatory? Something like.
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -1315,6 +1315,9 @@ static unsigned long __part_start_io_acct(struct
block_device *part,
const int sgrp = op_stat_group(op);
unsigned long now = READ_ONCE(jiffies);
+ if (!blk_queue_io_stat(part->bd_disk->queue))
+ return 0;
+
part_stat_lock();
update_io_ticks(part, now, false);
part_stat_inc(part, ios[sgrp]);
@@ -1351,6 +1354,9 @@ static void __part_end_io_acct(struct block_device
*part, unsigned int op,
unsigned long now = READ_ONCE(jiffies);
unsigned long duration = now - start_time;
+ if (!blk_queue_io_stat(part->bd_disk->queue))
+ return;
+
Thanks,
Guoqing
prev parent reply other threads:[~2021-05-13 7:24 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-08 3:48 [PATCH] md: don't account io stat for split bio Guoqing Jiang
2021-05-10 6:00 ` Christoph Hellwig
2021-05-10 7:46 ` Guoqing Jiang
2021-05-10 19:49 ` Artur Paszkiewicz
2021-05-11 2:13 ` Guoqing Jiang
2021-05-11 4:38 ` Christoph Hellwig
2021-05-11 6:59 ` Song Liu
2021-05-11 7:11 ` Christoph Hellwig
2021-05-11 6:58 ` Song Liu
2021-05-11 7:10 ` Christoph Hellwig
2021-05-13 7:24 ` Guoqing Jiang [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5e91dccb-31f3-daa0-f974-9c3211cc6b15@gmail.com \
--to=jgq516@gmail.com \
--cc=artur.paszkiewicz@intel.com \
--cc=hch@infradead.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=pawel.wiejacha@rtbhouse.com \
--cc=song@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).