[RFD] Memory Corruption of CPU Hotplug on MIPS (Loongson-3)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, all,

I found that the "spawn" program of UnixBench may get segfault/bus
error or other memory corruptions when we do CPU hotplug on quad-core
Loongson-3. We have debug this for a long time but have no solution,
so I want to know whether this is not a Loongson-specific but a
MIPS-specific problem.

Testbed configuration:
Linux kernel-3.6.11 with Loongson-3 patches (the linux-3.6 branch of
http://dev.lemote.com/cgit/linux-official.git)
UnixBench-5.1.3 (http://code.google.com/p/byte-unixbench/)
CPU hotplug script like this (hotplug.sh):
--
while true; do
echo 0 >/sys/devices/system/cpu/cpu1/online
echo 0 >/sys/devices/system/cpu/cpu2/online
echo 0 >/sys/devices/system/cpu/cpu3/online
sleep 1
echo 1 >/sys/devices/system/cpu/cpu1/online
echo 1 >/sys/devices/system/cpu/cpu2/online
echo 1 >/sys/devices/system/cpu/cpu3/online
done
--

Test method:
1, run "hotplug.sh" and then run "spawn 10000", spawn will get
segfault after a few minutes.
2, run "hotplug.sh" and then run "taskset -c 0 spawn 10000" (spawn
runs only on core-0), spawn will get segfault in half an hour.
3, run "taskset -c 0 hotplug.sh" and then run "spawn 10000"
(hotplug.sh runs only on core-0), spawn will get segfault in half an
hour.
4, run "taskset -c 0 hotplug.sh" and then run "taskset -c 0 spawn
10000" (both spawn and hotplug.sh run only on core-0), spawn will
finish successfully after about 3 hours.

This looks like the bug fixed in the below commit, but Linux-3.6
already have merged this patch:
--
commit 5c200197130e307de6eba72fc335c83c9dd6a5bc
Author: Maksim Rayskiy <maksim.rayskiy@xxxxxxxxx>
Date:   Thu Nov 10 17:59:45 2011 +0000

    MIPS: ASID conflict after CPU hotplug
--

BTW, we found that if we do build_clear_page()/build_copy_page() in
cpu_cache_init() only on Core-0 at the first boot time (Don't do it
while CPU Hotplug, and don't do it on Core-1,2,3), the possibility of
segfault decreases.

Any ideas?

Best wishes,
Huacai Chen


[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux