From: Mikulas Patocka <mpatocka@redhat.com>
To: Eric Biggers <ebiggers@kernel.org>
Cc: LongPing Wei <weilongping@oppo.com>,
agk@redhat.com, dm-devel@lists.linux.dev, guoweichao@oppo.com,
snitzer@kernel.org, Bart Van Assche <bvanassche@acm.org>
Subject: Re: [PATCH v2] dm-verity: support block number limits for different ioprio classes
Date: Wed, 26 Mar 2025 19:50:34 +0100 (CET) [thread overview]
Message-ID: <052d22b6-2d49-7faf-49f3-742c9b79fc8e@redhat.com> (raw)
In-Reply-To: <20250326165336.GB1243@sol.localdomain>
On Wed, 26 Mar 2025, Eric Biggers wrote:
> On Wed, Mar 26, 2025 at 09:32:27PM +0800, LongPing Wei wrote:
> > On 2025/3/26 19:04, Mikulas Patocka wrote:
> > >
> > >
> > > On Wed, 26 Mar 2025, LongPing Wei wrote:
> > >
> > > > Calling verity_verify_io in bh for IO of all sizes is not suitable for
> > > > embedded devices. From our tests, it can improve the performance of 4K
> > > > synchronise random reads.
> > > > For example:
> > > > ./fio --name=rand_read --ioengine=psync --rw=randread --bs=4K \
> > > > --direct=1 --numjobs=8 --runtime=60 --time_based --group_reporting \
> > > > --filename=/dev/block/mapper/xx-verity
> > > >
> > > > But it will degrade the performance of 512K synchronise sequential reads
> > > > on our devices.
> > > > For example:
> > > > ./fio --name=read --ioengine=psync --rw=read --bs=512K --direct=1 \
> > > > --numjobs=8 --runtime=60 --time_based --group_reporting \
> > > > --filename=/dev/block/mapper/xx-verity
> > > >
> > > > A parameter array is introduced by this change. And users can modify the
> > > > default config by /sys/module/dm_verity/parameters/use_bh_bytes.
> > > >
> > > > The default limits for NONE/RT/BE/IDLE is set to 4096.
> > > >
> > > > Call verity_verify_io directly when verity_end_io is in softirq.
> > > >
> > > > Signed-off-by: LongPing Wei <weilongping@oppo.com>
> > >
> > > Are you sure that 4096 bytes is the correct threshold?
> > >
> > > I suggest that you run the benchmarks for 4k, 8k, 16k, 32k, 64k, 128k,
> > > 256k, 512k and set the default threshold to the largest value where bh
> > > code performs better than non-bh code.
> > >
> > > Mikulas
> > >
>
> 4096 bytes sounds good to me. As I mentioned elsewhere in the thread
> (https://lore.kernel.org/dm-devel/20250326164057.GA1243@sol.localdomain/),
> objections keep getting raised to doing more work in softirq context due to
> potential impact on real-time tasks. So while more I/O benchmarks would be
> interesting, they are also not the whole story and we should probably prefer a
> more conservative threshold. Also, dm-verity I/O requests have a bimodal
> distribution with peaks at 4 KiB (for synchronous reads) and 128 KiB or
> read_ahead_kb (for readahead) anyway, so most of the impact should come from 4
> KiB anyway.
>
> 8 KiB could also be reasonable when taking into account multibuffer hashing
> though, since multibuffer hashing makes hashing two 4 KiB blocks almost as fast
> as hashing a single 4 KiB block. (Though multibuffer hashing is currently
> Android-only, as the crypto maintainer keeps rejecting it upstream.)
>
> - Eric
OK, so I'll set it to 8KiB.
Do you think that I should increase this limit to "unlimited" for
IOPRIO_CLASS_RT and disable this feature at all for IOPRIO_CLASS_NONE?
Mikulas
next prev parent reply other threads:[~2025-03-26 18:50 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-25 10:49 [PATCH] dm-verity: support block number limits for different ioprio classes LongPing Wei
2025-03-25 17:43 ` Eric Biggers
2025-03-26 2:09 ` LongPing Wei
2025-03-26 16:40 ` Eric Biggers
2025-03-25 21:17 ` Mikulas Patocka
2025-03-26 1:30 ` [PATCH v2] " LongPing Wei
2025-03-26 5:18 ` Eric Biggers
2025-03-26 6:34 ` LongPing Wei
2025-03-26 11:04 ` Mikulas Patocka
2025-03-26 13:32 ` LongPing Wei
2025-03-26 16:53 ` Eric Biggers
2025-03-26 18:50 ` Mikulas Patocka [this message]
2025-03-26 20:32 ` Bart Van Assche
2025-03-26 20:48 ` Eric Biggers
2025-03-27 0:52 ` LongPing Wei
2025-03-27 17:05 ` Eric Biggers
2025-03-27 17:12 ` Mikulas Patocka
2025-03-27 17:35 ` Eric Biggers
2025-03-27 19:03 ` Mikulas Patocka
2025-03-27 19:39 ` Mikulas Patocka
2025-03-27 2:18 ` [PATCH v3] " LongPing Wei
2025-03-27 16:16 ` Mikulas Patocka
2025-03-27 16:57 ` Eric Biggers
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=052d22b6-2d49-7faf-49f3-742c9b79fc8e@redhat.com \
--to=mpatocka@redhat.com \
--cc=agk@redhat.com \
--cc=bvanassche@acm.org \
--cc=dm-devel@lists.linux.dev \
--cc=ebiggers@kernel.org \
--cc=guoweichao@oppo.com \
--cc=snitzer@kernel.org \
--cc=weilongping@oppo.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.