On Sat, Oct 21, 2023 at 02:05:39PM +0100, Richard W.M. Jones wrote: > http://oirase.annexia.org/tmp/2023-03-08-flamegraphs.mp4 [57M, 15m41s] ... > Captures work across userspace and kernel code, as shown in the third > example which is a KVM (ie. hardware assisted) virtual machine doing > some highly parallel work inside: > > http://oirase.annexia.org/tmp/2023-kvm-build.svg > > You can clearly see the 8 virtual (guest) CPUs on the left side, using > KVM. More interesting is that this guest uses a qcow2 file for disk > and there's a heck of an overhead writing to that file. There's > nothing to fix here -- qcow2 files shouldn't be used in this > situation; for best performance it would be better to use a local > block device to back the guest. We had some discussion on chat about this trace so I want to clarify two things. The problem is not qcow2, but using a regular file as backing for the guest disk. I reran the test using a block device and things are, well, different: http://oirase.annexia.org/tmp/2023-kvm-build-on-device.svg (The block device backed test ran quicker.) Which brings me to the second point of clarification. perf cycles collection only samples processes which are running. In both the flamegraphs here, the host machine is mostly idle. This sampling is sometimes exactly what you want. But unless you're aware of it, it can mislead. In particular it has the effect of exaggerating things which are actually not taking much time. 'wpa_supplicant', for example, is not consuming a huge 3.2% of the entire system, but 3.2% of the non-idle time of the system, which is a very different thing. I covered this point in my talk (see link above), but wanted to emphasize it. It is also something that is hopefully fixed when we get perf --off-cpu support, see adjacent subthread. (Thanks Hanna & Dan for raising these questions) Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v _______________________________________________ devel mailing list -- devel@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe send an email to devel-leave@xxxxxxxxxxxxxxxxxxxxxxx Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/devel@xxxxxxxxxxxxxxxxxxxxxxx Do not reply to spam, report it: https://pagure.io/fedora-infrastructure/new_issue