From: Eric Biggers <ebiggers@kernel.org>
To: Mikulas Patocka <mpatocka@redhat.com>
Cc: Frank.Li@oss.nxp.com, Alasdair Kergon <agk@redhat.com>,
Mike Snitzer <snitzer@kernel.org>,
Benjamin Marzinski <bmarzins@redhat.com>,
Song Liu <song@kernel.org>, Yu Kuai <yukuai@fygo.io>,
Li Nan <magiclinan@didiglobal.com>, Xiao Ni <xiao@kernel.org>,
Dan Williams <djbw@kernel.org>,
Herbert Xu <herbert@gondor.apana.org.au>,
"David S. Miller" <davem@davemloft.net>,
Jonathan Corbet <corbet@lwn.net>,
Shuah Khan <skhan@linuxfoundation.org>,
Randy Dunlap <rdunlap@infradead.org>,
dm-devel@lists.linux.dev, linux-kernel@vger.kernel.org,
linux-raid@vger.kernel.org, linux-crypto@vger.kernel.org,
linux-doc@vger.kernel.org, Anatolij Gustschin <agust@denx.de>,
Saeed Bishara <saeed@marvell.com>,
Rameshwar Prasad Sahu <rsahu@apm.com>,
Thomas Petazzoni <thomas.petazzoni@free-electrons.com>,
Anup Patel <anup.patel@broadcom.com>, Frank Li <Frank.Li@nxp.com>
Subject: Re: [PATCH RFC 1/4] md/dm-integrity: replace async_tx with synchronous xor for journal
Date: Thu, 22 Oct 2026 22:11:54 +0000 [thread overview]
Message-ID: <20261022221154.GA1591067@google.com> (raw)
In-Reply-To: <20261022214457.GB1383716@google.com>
On Thu, Oct 22, 2026 at 09:44:57PM +0000, Eric Biggers wrote:
> On Thu, Oct 22, 2026 at 03:24:18PM +0200, Mikulas Patocka wrote:
> > > async_tx adds significant complexity and maintenance overhead while
> > > providing little practical benefit on modern systems, where RAID parity
> > > computation is typically performed more efficiently by CPU-based XOR/PQ
> > > implementations than by DMA engine offload.
>
> This patch is to dm-integrity, which is doing an XOR, but not for a RAID
> parity computation. The above paragraph should be adjusted.
>
> > > ---
> > > drivers/md/dm-integrity.c | 26 ++++++++++++++------------
> > > 1 file changed, 14 insertions(+), 12 deletions(-)
>
> Should also drop the 'select ASYNC_XOR' from CONFIG_DM_INTEGRITY.
>
> > > + src0 = kmap_local_page(source_pl[pl_index].page);
> > > + src1 = kmap_local_page(ic->journal_xor[pl_index].page);
> > > + dst = kmap_local_page(target_pl[pl_index].page);
> > > +
> > > + memcpy(dst + pl_offset, src0 + pl_offset, this_step);
> > > + crypto_xor(dst + pl_offset, src1 + pl_offset, this_step);
>
> crypto_xor_cpy(), instead of memcpy() + crypto_xor().
>
> Also, these pages come from dm_integrity_alloc_page_list() which
> allocates them in lowmem, and elsewhere in the file they are accessed
> using lowmem_page_address(). So the kmap_local is not necessary.
>
> Also note that crypto_xor() and crypto_xor_cpy() just use scalar
> instructions. Probably fine (it's just an XOR after all), but it might
> be worthwhile to mention why xor_gen() isn't used instead. Is it
> because the pointers and lengths aren't aligned well enough for that?
> Or just because not enough data is being processed here to bother?
There's also a stale comment:
/* mirror async_tx per-page completion accounting */
complete_journal_op(comp);
- Eric
next prev parent reply other threads:[~2026-10-22 22:11 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-15 19:22 [PATCH RFC 0/4] async_tx/md: Remove async_tx framework Frank.Li
2026-10-15 19:22 ` [PATCH RFC 1/4] md/dm-integrity: replace async_tx with synchronous xor for journal Frank.Li
2026-10-22 13:24 ` Mikulas Patocka
2026-10-22 21:44 ` Eric Biggers
2026-10-22 22:11 ` Eric Biggers [this message]
2026-10-15 19:22 ` [PATCH RFC 2/4] md/raid5-ppl: replace async_tx with synchronous xor Frank.Li
2026-10-15 19:22 ` [PATCH RFC 3/4] md/raid5: replace async_tx with synchronous xor/pq operations Frank.Li
2026-10-15 19:22 ` [PATCH RFC 4/4] crypto: remove async_tx framework Frank.Li
2026-10-15 19:51 ` [PATCH RFC 0/4] async_tx/md: Remove " 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=20261022221154.GA1591067@google.com \
--to=ebiggers@kernel.org \
--cc=Frank.Li@nxp.com \
--cc=Frank.Li@oss.nxp.com \
--cc=agk@redhat.com \
--cc=agust@denx.de \
--cc=anup.patel@broadcom.com \
--cc=bmarzins@redhat.com \
--cc=corbet@lwn.net \
--cc=davem@davemloft.net \
--cc=djbw@kernel.org \
--cc=dm-devel@lists.linux.dev \
--cc=herbert@gondor.apana.org.au \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-raid@vger.kernel.org \
--cc=magiclinan@didiglobal.com \
--cc=mpatocka@redhat.com \
--cc=rdunlap@infradead.org \
--cc=rsahu@apm.com \
--cc=saeed@marvell.com \
--cc=skhan@linuxfoundation.org \
--cc=snitzer@kernel.org \
--cc=song@kernel.org \
--cc=thomas.petazzoni@free-electrons.com \
--cc=xiao@kernel.org \
--cc=yukuai@fygo.io \
/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
all inboxes | Powered by JetHome®