Linux block layer
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Kanchan Joshi <joshi.k@samsung.com>,
	Christoph Hellwig <hch@lst.de>,
	"kundan.kumar" <kundan.kumar@samsung.com>
Cc: kbusch@kernel.org, linux-block@vger.kernel.org
Subject: Re: [PATCH] block: skip QUEUE_FLAG_STATS and rq-qos for passthrough io
Date: Thu, 23 Nov 2023 13:19:08 -0700	[thread overview]
Message-ID: <37d9ca26-2ec2-4c51-8d33-a736f54ef93f@kernel.dk> (raw)
In-Reply-To: <85be66ad-0203-6f81-8be0-1190842c9273@samsung.com>

On 11/23/23 11:12 AM, Kanchan Joshi wrote:
> On 11/23/2023 9:00 PM, Christoph Hellwig wrote:
>> The rest looks good, but that stats overhead seems pretty horrible..
> 
> On my setup
> Before[1]: 7.06M
> After[2]: 8.29M
> 
> [1]
> # taskset -c 2,3 t/io_uring -b512 -d256 -c32 -s32 -p1 -F1 -B1 -O0 -n2 
> -u1 -r4 /dev/ng0n1 /dev/ng1n1
> submitter=0, tid=2076, file=/dev/ng0n1, node=-1
> submitter=1, tid=2077, file=/dev/ng1n1, node=-1
> polled=1, fixedbufs=1/0, register_files=1, buffered=1, QD=256
> Engine=io_uring, sq_ring=256, cq_ring=256
> polled=1, fixedbufs=1/0, register_files=1, buffered=1, QD=256
> Engine=io_uring, sq_ring=256, cq_ring=256
> IOPS=6.95M, BW=3.39GiB/s, IOS/call=32/31
> IOPS=7.06M, BW=3.45GiB/s, IOS/call=32/32
> IOPS=7.06M, BW=3.45GiB/s, IOS/call=32/31
> Exiting on timeout
> Maximum IOPS=7.06M
> 
> [2]
>   # taskset -c 2,3 t/io_uring -b512 -d256 -c32 -s32 -p1 -F1 -B1 -O0 -n2 
> -u1 -r4 /dev/ng0n1 /dev/ng1n1
> submitter=0, tid=2123, file=/dev/ng0n1, node=-1
> submitter=1, tid=2124, file=/dev/ng1n1, node=-1
> polled=1, fixedbufs=1/0, register_files=1, buffered=1, QD=256
> Engine=io_uring, sq_ring=256, cq_ring=256
> IOPS=8.27M, BW=4.04GiB/s, IOS/call=32/31
> IOPS=8.29M, BW=4.05GiB/s, IOS/call=32/31
> IOPS=8.29M, BW=4.05GiB/s, IOS/call=31/31
> Exiting on timeout
> Maximum IOPS=8.29M

It's all really down to how expensive getting the current time is on
your box, some will be better and some worse

One idea that has been bounced around in the past is to have a
blk_ktime_get_ns() and have it be something ala:

u64 blk_ktime_get_ns(void)
{
	struct blk_plug *plug = current->plug;

	if (!plug)
		return ktime_get_ns();

	if (!plug->ktime_valid)
		plug->ktime = ktime_get_ns();

	return plug->ktime;
}

in freestyle form, with the idea being that we don't care granularity to
the extent that we'd need a new stamp every time.

If the task is scheduled out, the plug is flushed anyway, which should
invalidate the stamp. For preemption this isn't true iirc, so we'd need
some kind of blk_flush_plug_ts() or something for that case to
invalidate it.

Hopefully this could then also get away from passing in a cached value
that we do in various spots, exactly because all of this time stamping
is expensive. It's also a bit of a game of whack-a-mole, as users get
added and distro kernels tend to turn on basically everything anyway.

-- 
Jens Axboe


  reply	other threads:[~2023-11-23 20:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20231123103102epcas5p2aee268735dc9e0c357e6d3b98d16fe21@epcas5p2.samsung.com>
2023-11-23 10:24 ` [PATCH] block: skip QUEUE_FLAG_STATS and rq-qos for passthrough io kundan.kumar
2023-11-23 15:30   ` Christoph Hellwig
2023-11-23 18:12     ` Kanchan Joshi
2023-11-23 20:19       ` Jens Axboe [this message]
2023-11-23 20:37         ` Jens Axboe
2023-11-24 11:28           ` Kundan Kumar
2023-12-01 12:11             ` Kundan Kumar
2023-12-01 14:31             ` Jens Axboe
2023-11-23 20:07     ` Jens Axboe

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=37d9ca26-2ec2-4c51-8d33-a736f54ef93f@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=joshi.k@samsung.com \
    --cc=kbusch@kernel.org \
    --cc=kundan.kumar@samsung.com \
    --cc=linux-block@vger.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