Hi,

Sorry for the late reply. I spent some time reworking the prototype along the
lines suggested in the previous discussion, and also tried to make the
VDO-level measurements more explicit.


There were two main points in the previous feedback. The first was that IAA
support should not add IAA-specific branches in the VDO data path, such as:


    if (iaa_enabled)
            ...
    else
            ...


Instead, the VDO compression path should use the kernel asynchronous
compression API, so that IAA can be plugged in through the existing crypto API
and the VDO code does not need to know about a specific accelerator. The
second point was that the benefit should be shown at the dm-vdo level, because
raw compression-algorithm benchmarks do not necessarily translate into
user-visible VDO throughput or data-efficiency gains.


The attached patch is my current prototype for the first point. It replaces the
direct LZ4 calls in the VDO compression path with a crypto acomp based
compression context. The prototype uses the configured crypto compression
algorithm for VDO compression and decompression, so the IAA path can be reached
through deflate-iaa without adding IAA-specific checks in data-vio.c.


This is still an RFC prototype, not a final patch series. In particular, I am
not trying to claim that this patch solves the full long-term metadata problem
for mixing arbitrary compression algorithms in one VDO format. My immediate
goal is narrower: make the IAA implementation follow the generic async
compression API direction, and check whether that is an acceptable basis for
preparing a proper mergeable series.


The attached patch also contains a small amount of temporary
compression-statistics/debug code. I used it only to identify the VDO
compression entry point and report VDO-level input and payload sizes for the
comparison below. It is not required for the functional part of IAA support,
and I can drop it or keep it behind debug guards when splitting the work into
reviewable patches.


For the VDO-level test, the data set was silesia.tar, a tar archive of the
files from the Silesia corpus. I did not configure the VDO thread counts, so
they used the default startup parameters. For this test I only enabled VDO
compression and disabled deduplication:


    lvcreate --type vdo -n vdo_lv -L 180G -V 200G \
        --compression=y --deduplication=n \
        vdo_vg


I then created and mounted an ext4 filesystem on top of the VDO device, and
used dd on regular files in the mounted filesystem to measure read/write
throughput. The write test copied the Silesia tar archive into the mounted
filesystem:


    dd if=../silesia_raw.tar of=./silesia.tar bs=1M oflag=direct


The read test read the same file back from the mounted ext4 filesystem:


    dd if=./silesia.tar of=/dev/null bs=1M iflag=direct


After the write test, I queried the VDO compression statistics with:


    dmsetup message vdo_vg-vpool0-vpool 0 compress-stats


The temporary compress-stats fields mean:


    calls: number of VDO compression calls counted in this run
    input_bytes: total bytes passed to the compressor by VDO
    payload_bytes: total compressed payload bytes produced by the 
compressor
    saved_bytes: input_bytes - payload_bytes
    ratio_x100: payload_bytes / input_bytes * 100, truncated to an 
integer
    ratio: the same payload/input ratio printed as a decimal value


LZ4 result:


    write:
        202+1 records in
        202+1 records out
        211,957,760 bytes copied, 0.357554 s, 593 MB/s
    read:
        202+1 records in
        202+1 records out
        211,957,760 bytes copied, 0.183408 s, 1.2 GB/s
    compress-stats:
        calls 51626
        input_bytes 211460096
        payload_bytes 122705607
        saved_bytes 88754489
        ratio_x100 58
        ratio 0.58x


IAA/deflate result:


    write:
        202+1 records in
        202+1 records out
        211,957,760 bytes copied, 0.228480 s, 928 MB/s
    read:
        202+1 records in
        202+1 records out
        211,957,760 bytes copied, 0.183265 s, 1.2 GB/s
    compress-stats:
        calls 51626
        input_bytes 211460096
        payload_bytes 107585987
        saved_bytes 103874109
        ratio_x100 50
        ratio 0.50x


The two runs had the same number of compression calls and the same VDO
compression input size. On this 211.5 MB VDO compression input, IAA/deflate
stored about 107.6 MB of payload, while LZ4 stored about 122.7 MB. That is
about 15.1 MB less payload for IAA/deflate on this data set.


The throughput result also looks more useful than my earlier report. With the
default VDO thread settings, the write-side dd result improved from 593 MB/s
with LZ4 to 928 MB/s with IAA/deflate, while the read-side result stayed
essentially the same at about 1.2 GB/s. This matches the lower-level 4KB
compression tests I ran earlier: IAA showed higher compression bandwidth than
LZ4 at that granularity, while its decompression bandwidth was not better than
LZ4. So the VDO result is consistent with IAA helping the compressed write path
more than the read/decompression path.


My question is whether this revised approach is a reasonable direction for
adding IAA support to dm-vdo: use the generic async compression API in the VDO
compression path, avoid IAA-specific branches, and then split the prototype
into smaller reviewable patches. If this direction looks acceptable, I can
continue by removing or isolating the temporary statistics code, improving the
benchmark description, and preparing a proper patch series.


Regards,
Ze Fu
         原始邮件
         
       
发件人:Matthew Sakai <[email protected]&gt;
发件时间:2026年5月5日 01:03
收件人:Mikulas Patocka <[email protected]&gt;
抄送:... <[email protected]&gt;, dm-devel <[email protected]&gt;
主题:Re: dm vdo: add optional Intel IAA-backed compression support





On&nbsp;5/4/26&nbsp;12:01&nbsp;PM,&nbsp;Mikulas&nbsp;Patocka&nbsp;wrote:
&gt;&nbsp;
&gt;&nbsp;
&gt;&nbsp;On&nbsp;Wed,&nbsp;29&nbsp;Apr&nbsp;2026,&nbsp;Matthew&nbsp;Sakai&nbsp;wrote:
&gt;&nbsp;
&gt;&gt;
&gt;&gt;
&gt;&gt;&nbsp;On&nbsp;4/29/26&nbsp;11:24&nbsp;AM,&nbsp;Mikulas&nbsp;Patocka&nbsp;wrote:
&gt;&gt;&gt;&nbsp;Hi
&gt;&gt;&gt;
&gt;&gt;&gt;&nbsp;I&nbsp;think&nbsp;the&nbsp;best&nbsp;way&nbsp;how&nbsp;to&nbsp;support&nbsp;it&nbsp;would&nbsp;be&nbsp;to&nbsp;modify&nbsp;the&nbsp;VDO&nbsp;target
&gt;&gt;&gt;&nbsp;to&nbsp;use&nbsp;the&nbsp;asynchronous&nbsp;compression&nbsp;API&nbsp;(so&nbsp;that&nbsp;it&nbsp;could&nbsp;use&nbsp;arbitrary
&gt;&gt;&gt;&nbsp;algorithms).&nbsp;Then,&nbsp;the&nbsp;support&nbsp;for&nbsp;IAA&nbsp;could&nbsp;be&nbsp;plugged&nbsp;in&nbsp;easily&nbsp;with
&gt;&gt;&gt;&nbsp;little&nbsp;or&nbsp;no&nbsp;extra&nbsp;code.
&gt;&gt;
&gt;&gt;&nbsp;I&nbsp;agree&nbsp;that&nbsp;this&nbsp;is&nbsp;the&nbsp;right&nbsp;approach,&nbsp;but&nbsp;supporting&nbsp;arbitrary&nbsp;compression
&gt;&gt;&nbsp;algorithms&nbsp;will&nbsp;require&nbsp;some&nbsp;significant&nbsp;changes&nbsp;on&nbsp;its&nbsp;own.&nbsp;dm-vdo&nbsp;currently
&gt;&gt;&nbsp;has&nbsp;nowhere&nbsp;to&nbsp;store&nbsp;information&nbsp;about&nbsp;what&nbsp;algorithm&nbsp;is&nbsp;used&nbsp;for&nbsp;which
&gt;&gt;&nbsp;blocks,&nbsp;so&nbsp;it&nbsp;would&nbsp;require&nbsp;reworking&nbsp;the&nbsp;metadata.&nbsp;(We&nbsp;would&nbsp;probably&nbsp;store
&gt;&nbsp;
&gt;&nbsp;You&nbsp;can&nbsp;store&nbsp;the&nbsp;algorithm&nbsp;in&nbsp;the&nbsp;superblock&nbsp;and&nbsp;use&nbsp;it&nbsp;for&nbsp;all&nbsp;blocks&nbsp;on
&gt;&nbsp;the&nbsp;device.&nbsp;This&nbsp;would&nbsp;be&nbsp;not&nbsp;as&nbsp;flexible&nbsp;as&nbsp;per-block&nbsp;algorithm
&gt;&nbsp;specification,&nbsp;but&nbsp;it&nbsp;should&nbsp;be&nbsp;relatively&nbsp;easy&nbsp;to&nbsp;implement&nbsp;-&nbsp;and&nbsp;it
&gt;&nbsp;would&nbsp;allow&nbsp;you&nbsp;to&nbsp;evaluate&nbsp;whether&nbsp;different&nbsp;algorithms&nbsp;improve
&gt;&nbsp;performance&nbsp;or&nbsp;compression&nbsp;ratio.

We&nbsp;could&nbsp;do&nbsp;that,&nbsp;certainly.&nbsp;It&nbsp;means&nbsp;picking&nbsp;the&nbsp;compression&nbsp;algorithm&nbsp;
at&nbsp;format&nbsp;time,&nbsp;which&nbsp;also&nbsp;means&nbsp;no&nbsp;existing&nbsp;vdo&nbsp;volumes&nbsp;could&nbsp;take&nbsp;
advantage&nbsp;of&nbsp;it.&nbsp;But&nbsp;we'd&nbsp;still&nbsp;need&nbsp;an&nbsp;upgrade&nbsp;for&nbsp;existing&nbsp;volumes&nbsp;to&nbsp;
handle&nbsp;the&nbsp;new&nbsp;superblock&nbsp;field.&nbsp;I&nbsp;think&nbsp;managing&nbsp;the&nbsp;compression&nbsp;
algorithm&nbsp;per-block&nbsp;is&nbsp;not&nbsp;that&nbsp;much&nbsp;more&nbsp;work,&nbsp;especially&nbsp;since&nbsp;I've&nbsp;
already&nbsp;written&nbsp;much&nbsp;of&nbsp;it.

&gt;&gt;&nbsp;the&nbsp;extra&nbsp;compression&nbsp;information&nbsp;in&nbsp;the&nbsp;compression&nbsp;block&nbsp;header.)&nbsp;This
&gt;&gt;&nbsp;metadata&nbsp;rework&nbsp;in&nbsp;turn&nbsp;will&nbsp;require&nbsp;some&nbsp;effort&nbsp;to&nbsp;make&nbsp;sure&nbsp;we&nbsp;can&nbsp;continue
&gt;&gt;&nbsp;to&nbsp;support&nbsp;existing&nbsp;users&nbsp;who&nbsp;will&nbsp;want&nbsp;to&nbsp;continue&nbsp;to&nbsp;use&nbsp;dm-vdo&nbsp;volumes&nbsp;in
&gt;&gt;&nbsp;the&nbsp;current&nbsp;format.
&gt;&nbsp;
&gt;&nbsp;Mikulas
&gt;&nbsp;

Attachment: vdo-acomp-prototype.patch
Description: Binary data

Reply via email to