public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCHSET RFC 0/2] Cache issue side time querying
@ 2024-01-15 21:53 Jens Axboe
  2024-01-15 21:53 ` [PATCH 1/2] block: add blk_time_get_ns() helper Jens Axboe
  2024-01-15 21:53 ` [PATCH 2/2] block: cache current nsec time in struct blk_plug Jens Axboe
  0 siblings, 2 replies; 11+ messages in thread
From: Jens Axboe @ 2024-01-15 21:53 UTC (permalink / raw)
  To: linux-block

Hi,

When I run my peak testing to see if we've regressed, my test script
always does:

	echo 1 > /sys/block/$DEV/queue/iostats
	echo 2 > /sys/block/$DEV/queue/nomerges

for each device being used. It's unfortunate that we need to disable
iostats, but without doing that, I lose about 12% performance. The main
reason for that is the time querying we need to do, when iostats are
enabled. As it turns out, lots of other block code is quite trigger
happy with querying time as well. We do have some nice batching in place
which helps ammortize that, but it's not perfect.

This trivial patchset simply caches the current time in struct blk_plug,
on the premise that any issue side time querying can get adequate
granularity through that. Nobody really needs nsec granularity on the
timestamp.

Results in patch 2, but tldr is a more than 6% improvement (108M -> 115M
IOPS) for my test case, which doesn't even enable most of the costly
block layer items that you'd typically find in a distro and which would
further increase the number of issue side time calls.

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2024-01-16 16:18 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-15 21:53 [PATCHSET RFC 0/2] Cache issue side time querying Jens Axboe
2024-01-15 21:53 ` [PATCH 1/2] block: add blk_time_get_ns() helper Jens Axboe
2024-01-16  6:42   ` Yu Kuai
2024-01-16 14:41     ` Jens Axboe
2024-01-15 21:53 ` [PATCH 2/2] block: cache current nsec time in struct blk_plug Jens Axboe
2024-01-16  9:51   ` Kanchan Joshi
2024-01-16 10:25     ` Johannes Thumshirn
2024-01-16 10:47       ` Kanchan Joshi
2024-01-16 14:43     ` Jens Axboe
2024-01-16 16:13   ` Keith Busch
2024-01-16 16:18     ` Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox