diff options
author | Jong-Woo Chae <jongwoo.chae@samsung.com> | 2015-12-08 23:51:48 -0800 |
---|---|---|
committer | Jong-Woo Chae <jongwoo.chae@samsung.com> | 2015-12-08 23:51:48 -0800 |
commit | 45942c08c98fa5e78c7bc9e1475b1db603fca560 (patch) | |
tree | ffad5f2ea27e808440292b171943692596dfb26d | |
parent | a82e4a19e88da9bccb1fb539f66298a7e3b8cac6 (diff) | |
download | qemu-45942c08c98fa5e78c7bc9e1475b1db603fca560.tar.gz qemu-45942c08c98fa5e78c7bc9e1475b1db603fca560.tar.bz2 qemu-45942c08c98fa5e78c7bc9e1475b1db603fca560.zip |
Revert "Revert "linux-user: Run multi-threaded code on a single core""
This reverts commit a82e4a19e88da9bccb1fb539f66298a7e3b8cac6.
This revert commit harms stability of GBS build and may cause hang in OBS build.
Change-Id: I017d6accb0bcc7b2b2df662590ed05b81b82f28c
-rw-r--r-- | linux-user/syscall.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 84193cedf..52885ab05 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -4531,6 +4531,15 @@ static int do_fork(CPUArchState *env, unsigned int flags, abi_ulong newsp, if (nptl_flags & CLONE_SETTLS) cpu_set_tls (new_env, newtls); + /* agraf: Pin ourselves to a single CPU when running multi-threaded. + This turned out to improve stability for me. */ + { + cpu_set_t mask; + CPU_ZERO(&mask); + CPU_SET(0, &mask); + sched_setaffinity(0, sizeof(mask), &mask); + } + /* Grab a mutex so that thread setup appears atomic. */ pthread_mutex_lock(&clone_lock); |