[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [RFC v4 71/71] cpus-common: wait on the CPU lock for ex
From: |
Alex Bennée |
Subject: |
Re: [Qemu-devel] [RFC v4 71/71] cpus-common: wait on the CPU lock for exclusive work completion |
Date: |
Mon, 29 Oct 2018 15:31:13 +0000 |
User-agent: |
mu4e 1.1.0; emacs 26.1.50 |
Emilio G. Cota <address@hidden> writes:
> The current implementation of exclusive work can suffer from high
> contention when the number of guest CPUs is large (> 16 or so). The
> reason is that all CPUs end up waiting on the same condvar/mutex pair,
> which unnecessarily slows them down to wake up.
<snip>
FWIW this is the commit that breaks the linux-test code. I get the
following:
(gdb) thread apply all bt
Thread 2 (Thread 0x7ffff64d3700 (LWP 33607)):
#0 syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1 0x000055555574d6db in qemu_futex_wait (val=<optimized out>, f=<optimized
out>) at /home/alex.bennee/lsrc/qemu.git/include/qemu/futex.h:29
#2 qemu_event_wait (address@hidden <rcu_call_ready_event>) at
util/qemu-thread-posix.c:442
#3 0x0000555555754158 in call_rcu_thread (opaque=<optimized out>) at
util/rcu.c:261
#4 0x00007ffff6b3e6db in start_thread (arg=0x7ffff64d3700) at
pthread_create.c:463
#5 0x00007ffff686788f in clone () at
../sysdeps/unix/sysv/linux/x86_64/clone.S:95
Thread 1 (Thread 0x7ffff7fda500 (LWP 33603)):
#0 safe_syscall_base () at
/home/alex.bennee/lsrc/qemu.git/linux-user/host/x86_64/safe-syscall.inc.S:75
#1 0x000055555563793a in safe_wait4 (rusage=0x0, options=<optimized out>,
status=0x7fffffffc350, pid=1472725552) at
/home/alex.bennee/lsrc/qemu.git/linux-user/syscall.c:730
#2 do_syscall1 (address@hidden, address@hidden, address@hidden,
address@hidden, arg3=<optimized out>, arg4=0, arg5=4743376, arg6=4743168,
arg8=0, arg7=0) at /home/alex.bennee/lsrc/qemu.git/linux-user/syscall.c:8784
#3 0x000055555564225a in do_syscall (address@hidden, num=260, arg1=33608,
arg2=274886295360, arg3=<optimized out>, arg4=<optimized out>, arg5=4743376,
arg6=4743168, arg7=0, arg8=0) at
/home/alex.bennee/lsrc/qemu.git/linux-user/syscall.c:11432
#4 0x000055555564bc8a in cpu_loop (env=0x555557c88550) at
/home/alex.bennee/lsrc/qemu.git/linux-user/aarch64/cpu_loop.c:88
#5 0x00005555555e581c in main (argc=<optimized out>, argv=0x7fffffffe038,
envp=<optimized out>) at /home/alex.bennee/lsrc/qemu.git/linux-user/main.c:819
I don't seem to be able to step through it but it looks like the newly
spawned thread is blocked on the futex and the safe_wait4 never
progresses.
--
Alex Bennée
- [Qemu-devel] [RFC v4 01/71] cpu: convert queued work to a QSIMPLEQ, Emilio G. Cota, 2018/10/25
- [Qemu-devel] [RFC v4 71/71] cpus-common: wait on the CPU lock for exclusive work completion, Emilio G. Cota, 2018/10/25
- Re: [Qemu-devel] [RFC v4 71/71] cpus-common: wait on the CPU lock for exclusive work completion,
Alex Bennée <=
- [Qemu-devel] [RFC v4 67/71] cpus-common: release BQL earlier in run_on_cpu, Emilio G. Cota, 2018/10/25
- [Qemu-devel] [RFC v4 57/71] accel/tcg: convert to cpu_interrupt_request, Emilio G. Cota, 2018/10/25
- [Qemu-devel] [RFC v4 61/71] mips: convert to cpu_has_work_with_iothread_lock, Emilio G. Cota, 2018/10/25
- [Qemu-devel] [RFC v4 65/71] xtensa: convert to cpu_has_work_with_iothread_lock, Emilio G. Cota, 2018/10/25
- [Qemu-devel] [RFC v4 64/71] sparc: convert to cpu_has_work_with_iothread_lock, Emilio G. Cota, 2018/10/25