qemu-discuss
[Top][All Lists]
Advanced

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

[Qemu-discuss] SMP support in the user-mode


From: Soramichi AKIYAMA
Subject: [Qemu-discuss] SMP support in the user-mode
Date: Wed, 24 Aug 2016 15:10:29 +0900

Hi,

I am currently using the user-mode (not system-mode) of QEMU
for performance analysis of multi-threaded programs.

Although there are several discussions about SMP for the system-mode,
I cannot find a thorough documentation about SMP for the user-mode.
(I only found this: 
http://qemu.weilnetz.de/qemu-tech.html#clone_0028_0029-system-call-and-threads)
Is it correctly supported, or in work-in-progress, or in any other state?

One thing I want to know concretely is whether the below phenomenon is
a bug of QEMU or it is just because SMP is not fully supported in the user-mode.
1. A multi-threaded program inside the user-mode does use multiple cores of the 
host machine (which is great).
2. However, if pthread_mutex or pthread_spin_lock is used inside the program,
   releasing a lock fails with estimated probability of 0.1% or bit less (once 
per 1000+ trials I guess)
   and the program completely hangs up.

The complete environment is as follows.
- CPU:  Intel Xeon E5-2699 v3
- Target Arch: x86_64 (I run x86_64 binaries on a x86_64 host)
- OS: Debian GNU/Linux 8.5, kernel 3.16.7-ckt20
- GCC: Debian 4.9.2-10 (apt-get'ed from the Debian official repo)
- QEMU: 2.6.0 (the same observed with the latest code in the mainstream git 
repo)
- Config: --target=x86_64-linux-user --disable-system
- Example code that hangs up:
https://gist.github.com/soramichi/887a2305cbdbe72ca4846ea0b5b1f6ff
Specify -pthread to build. A spin lock is used if -DSPIN is specified, or a 
mutex is used otherwise.
'qemu-x86_64 a.out' lasts forever sometimes due to a failure of lock releasing.


I am happy to give any other information if necessary.
Thanks in advance,

Soramichi

--  
Soramichi AKIYAMA <address@hidden>
Artificial Intelligence Research Center,
National Institute of Advanced Industrial Science and Technology, Japan



reply via email to

[Prev in Thread] Current Thread [Next in Thread]