[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ZTwMu5uHcKnShoKU@redhat.com>
Date: Fri, 27 Oct 2023 15:17:15 -0400
From: Mike Snitzer <snitzer@...nel.org>
To: Christian Loehle <christian.loehle@....com>
Cc: dm-devel@...ts.linux.dev, agk@...hat.com,
linux-kernel@...r.kernel.org
Subject: Re: dm: delay: use kthread instead of timers and wq
On Fri, Oct 20 2023 at 7:46P -0400,
Christian Loehle <christian.loehle@....com> wrote:
> The current design of timers and wq to realize the delays
> is insufficient especially for delays below ~50ms.
> The design is enhanced with a kthread to flush the expired delays,
> trading some CPU time (in some cases) for better delay accuracy and
> delays closer to what the user requested for smaller delays.
> The new design is chosen as long as all the delays are below 50ms.
>
> Since bios can't be completed in interrupt context using a kthread
> is probably the most reasonable way to approach this.
>
> Testing with
> echo "0 2097152 zero" | dmsetup create dm-zeros
> for i in $(seq 0 20);
> do
> echo "0 2097152 delay /dev/mapper/dm-zeros 0 $i" | dmsetup create dm-delay-${i}ms;
> done
>
> Some performance numbers for comparison
> beaglebone black (single core) CONFIG_HZ_1000=y:
> fio --name=1msread --rw=randread --bs=4k --runtime=60 --time_based --filename=/dev/mapper/dm-delay-1ms
> Theoretical maximum: 1000 IOPS
> Previous: 250 IOPS
> Kthread: 500 IOPS
> fio --name=10msread --rw=randread --bs=4k --runtime=60 --time_based --filename=/dev/mapper/dm-delay-10ms
> Theoretical maximum: 100 IOPS
> Previous: 45 IOPS
> Kthread: 50 IOPS
> fio --name=1mswrite --rw=randwrite --direct=1 --bs=4k --runtime=60 --time_based --filename=/dev/mapper/dm-delay-1ms
> Theoretical maximum: 1000 IOPS
> Previous: 498 IOPS
> Kthread: 1000 IOPS
> fio --name=10mswrite --rw=randwrite --direct=1 --bs=4k --runtime=60 --time_based --filename=/dev/mapper/dm-delay-10ms
> Theoretical maximum: 100 IOPS
> Previous: 90 IOPS
> Kthread: 100 IOPS
> fio --name=10mswriteasync --rw=randwrite --direct=1 --bs=4k --runtime=60 --time_based --filename=/dev/mapper/dm-delay-10ms --numjobs=32 --iodepth=64 --ioengine=libaio --group_reporting
> Previous: 13.3k IOPS
> Kthread: 13.3k IOPS
> (This one is just to prove the new design isn't impacting throughput,
> not really about delays)
>
> Signed-off-by: Christian Loehle <christian.loehle@....com>
> ---
> v2:
> - Keep the timer wq and delay design for longer delays
> - Address the rest of Mike's minor comments
Hi,
I've picked this up. But I fixed various issues along the way.
Please see the staged commit here:
https://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm.git/commit/?h=dm-6.7&id=c1fce71d29b2a48fd6788f9555561fda0f0c1863
Issues ranged from whitespace, to removing needless forward
declaration, to removing stray changes (restoring 'continue;' in
flush_delayed_bios), actually using a bool for bool params, fixed
missing mutex_init, and use max() rather than opencode comparisons in
the ctr. I might be forgetting some other code change. ;)
I also tweaked the commit header for whitespace (line wrapping, etc).
Thanks,
Mike
Powered by blists - more mailing lists