How to check interrupts lively in your systems?

I need to see what kind of interrupts are handled by which CPU. Please run command: # cat /proc/interrupts or you can execute $ watch -n1 "cat /proc/interrupts" to watch interrupts every 1 second. See [1] [2] for more details. References: [1] [2] Answered by harryxiyou. » Read more

How to tune systems to achieve high performance in virtualization circumstances?

Most time, we need to tune system parameters to achieve better performance but what the general parameters to be tuned in Linux systems. I think you may want to add following parameters to Kernel boot (/etc/default/grub) parameters intel_idle.max_cstate=0 processor.max_cstate=0 idle=poll intel_pstate=disable At the same time, you may also want to shutdown/open Pause Loop Exiting (PLE). See [2] [3] for more details about PLE, and see [1] [4] for more details about Intel C-States and P-States. » Read more

How to get vCPU thread ID in QEMU/KVM host OS?

In order to collect more information about CPU information internal guest OS, we usually need to get vCPU’s thread ID in host OS. Solution 1: Under directory ‘/sys/fs/cgroup/cpuset/machine’, you will find virtual_machine_name.libvirt-qemu directory. And under this directory, you will find all vCPU sub-directories and under these dirs, you will find vCPU thread IDs. For example sysmen tmp1.libvirt-qemu # ls cgroup.clone_children cpuset.cpus cpuset.memory_migrate cpuset.memory_spread_slab cpuset.sched_relax_domain_level tasks vcpu2 vcpu5 cgroup.procs cpuset.mem_exclusive cpuset.memory_pressure cpuset.mems emulator vcpu0 vcpu3 cpuset.cpu_exclusive cpuset.mem_hardwall cpuset.memory_spread_page cpuset.sched_load_balance notify_on_release vcpu1 vcpu4 sysmen tmp1.libvirt-qemu # pwd /sys/fs/cgroup/cpuset/machine/tmp1.libvirt-qemu sysmen tmp1.libvirt-qemu # cat vcpu0/tasks 99461 sysmen tmp1.libvirt-qemu # taskset -pc 99461 pid 99461's current affinity list: 0 BTW, ‘# taskset -pc 99461’ will get this thread ID’s affinity information. » Read more

How to get processes’ I/O utilization percentage

Two notices: 1, a process has only one main thread which is itself. 2, a process has many threads. Solution 1: Please use taskstats [1] related interfaces, and send TASKSTATS_TYPE_PID and TASKSTATS_TYPE_TGID commands to kernel to get a process’s ‘blkio_delay_total’ parameter for a process with one main thread and a process with threads separately. Solution 2: instrument kernel to get process’s I/O utilization percentage. » Read more

For QEMU/KVM, how to share data between host and guest

General question for developers to access data between VM and VMM. As I know, paravirtualization solution is a good way to share data for VM and VMM since it has better performance. Please use Virtio 9p solution for QEMU/KVM. Note that you need to load 9p related modules for guest kernel. Add following in your virsh start xml file. <filesystem type='mount' accessmode='passthrough'> <source dir='host_dir_path'/> <target dir='testlabel'/> </filesystem> After start guest OS, run following command # mount testlabel /mnt/ -t 9p -o trans=virtio References [1] [2] [3] [4] Answered by harryxiyou. » Read more

How to dynamically attach a disk to running DomU in Xen?

I want to attach a disk to a DomU. The Xen DomU is running and should not be rebooted. Hence, changing its configuration file is not an option. How to dynamically attach a disk to running DomU in Xen? To attach phy:vg_xen/vm-228-large to vm-228 as xvdb, run this on Dom0: # xl block-attach vm-228 phy:vg_xen/vm-228-large xvdb w With the old xm tool stack, replace xl with xm. » Read more

How to Install Paravirtualized CentOS 7 DomU on Xen

This post introduces how to install a paravirtualized CentOS 7 DomU on Xen. The very common way of installing DomU does not work for CentOS 7. A little trick to set the repository and the network used by the VM should be used by adding a setting strings to the “extra=” field for this VM. Note that this tutorials was tested with CentOS 7.2 (1511). » Read more