<div dir="ltr"><div>Thanks for reply. After performing an additional testing with SSD. I have more questions.</div><div><br></div><div>Firstly, about the additional testing with SSD:<br><div>I tested it with SSD (in Linux software raid level 10 setup). The result shown using dm-integrity is faster than using XFS directly. For using dm-integrity, fio shows lots of I/O merges by the scheduler. Please find the attachment for the result.<br></div>

</div><div><br></div><div>Finally, please find the questions below:<br></div><div>1) So after the dm-integrity journal is written to the actual back end storage (hard drive), then fsync would then report completed?</div><div><br></div><div>2) To my understanding, for using dm-integrity with journal mode. Data has to written into the storage device twice (one part is the dm-integrity journal, the other one is the actual data). For the fio test, the data should be random and sustained for 60 seconds. But using dm-integrity with journal mode is still faster.<br></div><div><br></div><div>Thanks,</div><div>Patrick<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Jan 4, 2020 at 1:14 AM Mikulas Patocka <<a href="mailto:mpatocka@redhat.com" target="_blank">mpatocka@redhat.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><br>
<br>
On Fri, 3 Jan 2020, Patrick Dung wrote:<br>
<br>
> Hello,<br>
> <br>
> A quick question on dm-integrity. Does dm-integrity layer honors fsync?<br>
<br>
Yes it does.<br>
<br>
However, it writes data into the journal and when the journal is flushed, <br>
it reports the fsync function as finished.<br>
<br>
On a mechanical disk, writes to contiguous space (i.e. the journal) are <br>
faster than random writes all over the disk, that's why you see better <br>
performance with dm-integrity than without it.<br>
<br>
Mikulas<br>
<br>
> I was testing dm-integrity and performance. It had a strange result that using dm-integrity with journal is faster than a normal file system or dm-integrity with<br>
> bitmap (no journal). fio is used for testing the storage performance. The device is a SATA hard disk drive. Then I created a 100GB partition for testing.<br>
> <br>
> Below is the test cases:<br>
> <br>
> 1) XFS on a partition directly test case<br>
> <br>
> 2) dm-integrity: crc32c on a partition with default setting journal commit interval is 10 seconds. Then create XFS on it. test case<br>
> <br>
> 3) dm-integrity: crc32c on a partition default setting journal commit interval set to 5 seconds. Then create XFS on it.<br>
> <br>
> 4) dm-integrity:  crc32c on a partition default setting but using bitmap instead of journal. Then create XFS on it.<br>
> <br>
> FIO command:<br>
> <br>
> fio --filename=./t1 --direct=1 --rw=randrw --refill_buffers --norandommap --randrepeat=0 --ioengine=sync --bs=4k --rwmixread=75 --iodepth=16 --numjobs=8 --runtime=60<br>
> --group_reporting --fsync=1 --name=4ktest --size=4G<br>
> <br>
> Result:<br>
> <br>
>  1. Read/Write IOPS: 117/41. Read/Write Speed 481KB/s 168KB/s<br>
>  2. Read/Write IOPS: 178/59. Read/Write Speed 732KB/s 244KB/s<br>
>  3. Read/Write IOPS: 169/57. Read/Write Speed 695KB/s 236KB/s<br>
>  4. Read/Write IOPS: 97/32. Read/Write Speed 400K/s 131KB/s<br>
> The original discussion in: <a href="https://gitlab.com/cryptsetup/cryptsetup/issues/513" rel="noreferrer" target="_blank">https://gitlab.com/cryptsetup/cryptsetup/issues/513</a> . Milan Broz said the dm-devel mailing list is a suitable place to discuss the probem.<br>
> <br>
> Thanks in advance.<br>
> <br>
> Patrick<br>
> <br>
> </blockquote></div>