Why writes with O_DIRECT and O_SYNC still causing io merge?
<p>everyone</p>

<p>Recently, I did some test with fio to test my disk performance. I configured fio to use direct io and O_SYNC, and following is my configuration</p>

<pre><code>[global]
invalidate=0    # mandatory
direct=1
sync=1
thread=1
norandommap=1
runtime=10000
time_based=1

[write4k-rand]
stonewall
group_reporting
bs=4k
size=1g
rw=randwrite
numjobs=1
iodepth=1
</code></pre>

<p>However, when I monitor the disk performance through iostat while fio is running, I saw the following output.</p>

<pre><code>avg-cpu:  %user   %nice %system %iowait  %steal   %idle
           0.12    0.00    0.08    3.81    0.00   95.98

Device:         rrqm/s   wrqm/s     r/s     w/s   rsec/s   wsec/s avgrq-sz avgqu-sz   await  svctm  %util
sda               0.00    39.50    0.00  176.00     0.00  1648.00     9.36     1.02    5.81   5.65  99.50
</code></pre>

<p>wrqm/s is 39.50. If stop fio, wrqm/s is 0. Why is there still io merges when I'm doing direct io with O_SYNC? Please help me.</p>

<p>Thank you:-)</p>