Bug 975665 - Many times online/offline cpu cause guest hang
Many times online/offline cpu cause guest hang
Status: CLOSED DUPLICATE of bug 1073568
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: qemu-kvm (Show other bugs)
7.0
x86_64 Linux
medium Severity medium
: rc
: ---
Assigned To: Igor Mammedov
Virtualization Bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-06-19 01:26 EDT by FuXiangChun
Modified: 2014-03-10 08:40 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2014-03-10 08:40:43 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description FuXiangChun 2013-06-19 01:26:02 EDT
Description of problem:
As subject, online and offline cpu in guest via command line.
echo 0 >/sys/devices/system/cpu/cpuX/online
echo 1 >/sys/devices/system/cpu/cpuX/online 

Version-Release number of selected component (if applicable):
host and guest kernel version:
# uname -r
3.10.0-0.rc6.62.el7.x86_64

qemu-kvm version:
qemu-kvm-1.5.0-2.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1.boot rhel7 guest
 /usr/libexec/qemu-kvm -M q35 -cpu Opteron_G2 -enable-kvm -m 2048 -smp 8,sockets=2,cores=4,threads=1,maxcpus=254 -name hotplug-cpu -uuid a51eb497-bfd7-47c0-8b5b-0853716e3ce6 -rtc base=localtime,clock=host,driftfix=slew -drive file=/root/RHEL-7.0-20130606.0.Server.x86_64.qcow3bk,if=none,id=drive-system-disk,format=qcow2,cache=none,aio=native,werror=stop,rerror=stop,serial=QEMU-DISK1 -device virtio-blk-pci,drive=drive-system-disk,id=system-disk,bootindex=1 -netdev tap,id=hostnet0,vhost=on,script=/etc/qemu-ifup -device e1000,netdev=hostnet0,id=virtio-net-pci0,mac=08:2e:5f:0a:1d:b2,bus=pcie.0,addr=0x5,bootindex=2 -device virtio-balloon-pci,id=ballooning,bus=pcie.0,addr=0x6 -qmp tcp:0:4444,server,nowait -k en-us -boot menu=on -vnc :1 -monitor stdio -serial unix:/tmp/ttyS0,server,nowait

2.execute online/offline script inside guest
#!/bin/sh

SYS_CPU_DIR=/sys/devices/system/cpu

VICTIM_IRQ=15
IRQ_MASK=f0

iteration=0
while true; do
echo $iteration
echo $IRQ_MASK > /proc/irq/$VICTIM_IRQ/smp_affinity
for cpudir in $SYS_CPU_DIR/cpu[1-9]; do
echo 0 > $cpudir/online
done
sleep 8
for cpudir in $SYS_CPU_DIR/cpu[1-9]; do
echo 1 > $cpudir/online
done
iteration=`expr $iteration + 1`
done

or execute this script off-on.sh; while true;do sh off-on.sh;done 
echo 0 >/sys/devices/system/cpu/cpu1/online
cat /sys/devices/system/cpu/cpu1/online
echo 1 >/sys/devices/system/cpu/cpu1/online
sleep 3
echo 0 >/sys/devices/system/cpu/cpu2/online
cat /sys/devices/system/cpu/cpu2/online
echo 1 >/sys/devices/system/cpu/cpu2/online
sleep 3
echo 0 >/sys/devices/system/cpu/cpu3/online
cat /sys/devices/system/cpu/cpu3/online
echo 1 >/sys/devices/system/cpu/cpu3/online
sleep 3
echo 0 >/sys/devices/system/cpu/cpu4/online
cat /sys/devices/system/cpu/cpu4/online
echo 1 >/sys/devices/system/cpu/cpu4/online
sleep 4
echo 0 >/sys/devices/system/cpu/cpu5/online
echo 1 >/sys/devices/system/cpu/cpu5/online
sleep 4
echo 0 >/sys/devices/system/cpu/cpu6/online
echo 1 >/sys/devices/system/cpu/cpu6/online
sleep 4
echo 0 >/sys/devices/system/cpu/cpu7/online
echo 1 >/sys/devices/system/cpu/cpu7/online

3.

Actual results:
guest hang.

this is part of console messages:

: no hardware support
[   60.211623] kvm: no hardware support
[   61.110630] kvm: no hardware support
[   62.148648] kvm: no hardware support
[   62.943668] kvm: no hardware support
[   63.276006] INFO: rcu_sched detected stalls on CPUs/tasks: { 2 3 4 5 6 7} (detected by 1, t=90035 jiffies, g=2712, c=2711, q=551)
[   63.275006] Uhhuh. NMI received for unknown reason 20 on CPU 8.
[   63.275006] Do you have a strange power saving mode enabled?
[   63.275006] Dazed and confused, but trying to continue
[  315.196831] BUG: soft lockup - CPU#6 stuck for 22s! [migration/6:37]
[  315.255006] BUG: soft lockup - CPU#7 stuck for 22s! [migration/7:42]
[  115.080855] smpboot: CPU8: Not responding
[  169.826992] BUG: soft lockup - CPU#5 stuck for 23s! [migration/5:32]
[  169.930543] BUG: soft lockup - CPU#6 stuck for 23s! [migration/6:37]
[  170.004006] INFO: rcu_sched detected stalls on CPUs/tasks:[  170.004110] BUG: soft lockup - CPU#7 stuck for 23s! [migration/7:42]
[  197.695261] BUG: soft lockup - CPU#2 stuck for 23s! [migration/2:17]
[  197.719391] BUG: soft lockup - CPU#3 stuck for 23s! [migration/3:22

Expected results:
guest work well

Additional info:
Comment 2 Igor Mammedov 2014-03-10 08:40:43 EDT

*** This bug has been marked as a duplicate of bug 1073568 ***

Note You need to log in before you can comment on or make changes to this bug.