Skip to contentSkip to conversation

blktrace vs ftrace

DISCUSSION Matthias Brugger 2 participants 6 messages Feb 2, 2012 – Feb 8, 2012

lore
Share & tools
lore
#0 lore raw

Hi all,

I'm trying to analize I/O behavior of Qemu on the host.

I used blktrace and the blk tracer for ftrace but I see different I/O behavior.
I use 4 threads in the VM each reading sequentially a file. Readahead is turned off. With blktrace reads are transmitted in a sequential way, which means the next read will be executed when the first one has completed. In comparison with ftrace, up to 4 reads are issued to the disk in parallel.

I suppose the different behaviors are due to the overhead introduced by the tracers.
My doubt is, which tracer has less influence on the I/O behaviour and therefore reflects the system behaviour without tracing.

Thanks a lot,
Matthias

---
http://motzblog.wordpress.com/

#1 lore raw
Quoted 3 lines · Matthias Brugger

Hi all,

I'm trying to analize I/O behavior of Qemu on the host.

what is your complete command to invoke Qemu?

sometimes Qemu's I/O behaviour can be modified by certain parameter. All I know recent Qemu release (>= 1.x) use iothread by default, which might explain your 4 threads reads.

Signature · 7 lines
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com
#2 lore raw
Quoted 7 lines · Mulyadi Santosa
Quoted 3 lines · Matthias Brugger

Hi all,

I'm trying to analize I/O behavior of Qemu on the host.

what is your complete command to invoke Qemu?

qemu -hda scheduler.raw -drive file=/mnt/disk/testdisk2.img,if=virtio,cache=none -m 1024 -enable-kvm -k es -smp 2 -vnc 127.0.0.1:10 -smb /home/matthias/nfs/

Quoted 4 lines

sometimes Qemu's I/O behaviour can be modified by certain parameter. All I know recent Qemu release (>= 1.x) use iothread by default, which might explain your 4 threads reads.

I use qemu-0.15.1 configured with the following parameter:

./configure --disable-xen --enable-kvm --enable-io-thread --enable-vnc-thread --disable-darwin-user --disable-bsd-user --target-list=i386-softmmu

Signature · 2 lines
---
http://motzblog.wordpress.com/
#3 lore raw

Hi :)

Quoted 11 lines · Matthias Brugger

qemu -hda scheduler.raw -drive file=/mnt/disk/testdisk2.img,if=virtio,cache=none -m 1024 -enable-kvm -k es -smp 2 -vnc 127.0.0.1:10 -smb /home/matthias/nfs/

I use qemu-0.15.1 configured with the following parameter:

./configure --disable-xen re--enable-kvm --enable-io-thread --enable-vnc-thread --disable-darwin-user --disable-bsd-user --target-list=i386-softmmu

Looks like indeed you were seeing I/O threads from qemu kicks in.

I could only offer this explanation:
blktrace traces events in block level. In this level, I/O is likely serialized....unless you have more than one physical disks.

in ftrace, you see events right before it hits block level operation. Somewhere between VFS, filesystem operation and I/O scheduling which deals with queue reordering. In this case, parallel operation is likely to happen because more than processes could submit read or write.

Signature · 7 lines
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com
#4 lore raw

Hi,

Quoted 10 lines · Mulyadi Santosa

I could only offer this explanation:
blktrace traces events in block level. In this level, I/O is likely serialized....unless you have more than one physical disks.

in ftrace, you see events right before it hits block level operation. Somewhere between VFS, filesystem operation and I/O scheduling which deals with queue reordering. In this case, parallel operation is likely to happen because more than processes could submit read or write.

If I understand the patch which introduces the blk tracer to ftrace
(http://lwn.net/Articles/315508/) just uses the blktrace interface. So I wonder why using this influences the I/O behaviour.

Best regards,
Matthias

#5 lore raw

Hi Matthias...

Quoted 3 lines · Matthias Brugger

If I understand the patch which introduces the blk tracer to ftrace
(http://lwn.net/Articles/315508/) just uses the blktrace interface. So I wonder why using this influences the I/O behaviour.

Then I am completely clueless now. Better consult with qemu-devel mailing list.

PS: just crossed my mind, maybe ftrace that uses blktrace is actually tracing the qemu's virtio. Whereas blktrace is tracing the physical block access. This is just speculation, after re-reading that you use virtio and disable write caching.

Signature · 7 lines
regards,

Mulyadi Santosa
Freelance Linux trainer and consultant

blog: the-hydra.blogspot.com
training: mulyaditraining.blogspot.com