Wind River Support Network

HomeDefectsOVP-133
Fixed

OVP-133 : After running testLatency for kvm_rt, host IRQ affinity for Altera change from pCPU2 to pCPU1

Created: Jul 31, 2013    Updated: Mar 11, 2016
Resolved Date: Oct 10, 2013
Found In Version: 5.0.1
Fix Version: 5.0.1.8
Severity: Severe
Applicable for: Wind River Linux 5
Component/s: Kernel

Description

According to description in README.tuning, we need to set host IRQ affinity for Altera to pCPU2, but after running testLatency, it's affinity change from pCPU2 to pCPU1.

Workaround

 after first running testLatency, then again set affinity to pCPU2, and then run  testLatency again.

Steps to Reproduce

1. build ovp host and guest
/lpg-build/cdc/fast_prod/wrlinuxovp/dvd_install/lv21_13sp/wrlinux-5/wrlinux/configure --enable-board=intel-xeon-core --enable-kernel=preempt-rt --enable-rootfs=ovp-kvm --enable-addons=wr-ovp --with-template=feature/rt-latency,feature/rt-tests --with-layer=/folk/xdong/wr-testing/ovp-benchmark && make fs

/lpg-build/cdc/fast_prod/wrlinuxovp/dvd_install/lv21_13sp/wrlinux-5/wrlinux/configure --enable-board=x86-64-kvm-guest --enable-kernel=preempt-rt --enable-rootfs=ovp-guest --enable-addons=wr-ovp --with-template=feature/rt-latency,feature/rt-tests --with-layer=/folk/xdong/wr-testing/ovp-benchmark && make fs

2. boot host and guset

3. Adjuct RCU threads on host
maxcpus=`cat /proc/cpuinfo | grep -i processor | wc -l`
for i in `pgrep rcuo`; do taskset -c -p 0,4-$((maxcpus-1)) $i; done
for i in `pgrep rcu_`; do taskset -c -p 0,4-$((maxcpus-1)) $i; done

4.Disable SMI on host
/opt/wr-test/testcases/ovp/kvm_rt/src/host/disable_smi

5.Configure Proc Tuning Variables
echo 30 > /proc/sys/vm/stat_interval
echo -1 > /proc/sys/kernel/sched_rt_runtime_us

6.FPGA card pass through to guest
DOMAIN_FPGA=`lspci -nn | grep Altera| awk '{print $1}'`

7.Boot Guest
taskset -c 3 /usr/bin/qemu-system-x86_64 \
-cpu qemu64,+x2apic \
-smp 2,sockets=1,cores=2,threads=1 \
-m 2048 \
--enable-kvm \
-name rt,process=rt-kvm \
-no-reboot \
-no-hpet \
-nographic \
-kernel /boot/guest.kernel \
-append "root=/dev/vda rw console=ttyS0,115200 isolcpus=1 irqaffinity=0 clocksource=tsc tsc=perfect idle=poll highres=on selinux=0 enforcing=0" \
-drive file=/boot/guest_raw.img,if=virtio,cache=none \
-vcpu 0,affinity=0x2,prio=0 \
-vcpu 1,affinity=0x4,prio=80 -softirq 2,prio=81 \
-device pci-assign,host=0000:${DOMAIN_FPGA},vcpuaffine \
-mlock

8.On guest insmod FPGA device driver and create device node
/home/root/IntTest/startILatIntDrv.sh

9. On guest adjuct IRQ to vCPU1
/opt/wr-test/testcases/ovp/kvm_rt/src/guest/affine-guest

10. On host affine Adjuct to pCPU2
/opt/wr-test/testcases/ovp/kvm_rt/src/host/affine-host

11. Load vCPU1 to 95.00%
/opt/wr-test/testcases/ovp/kvm_rt/src/guest/load-cpu.sh cpu1

12. On guest execute IRQ latency test
/home/root/IntTest/testLatency

1: Start 1m periodic test    ---> check host IRQ affinity change form pCPU2 to pCpu1
Live chat
Online