summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJong-Woo Chae <jongwoo.chae@samsung.com>2015-12-09 07:51:48 (GMT)
committerJong-Woo Chae <jongwoo.chae@samsung.com>2015-12-09 07:51:48 (GMT)
commit45942c08c98fa5e78c7bc9e1475b1db603fca560 (patch)
treeffad5f2ea27e808440292b171943692596dfb26d
parenta82e4a19e88da9bccb1fb539f66298a7e3b8cac6 (diff)
downloadqemu-45942c08c98fa5e78c7bc9e1475b1db603fca560.zip
qemu-45942c08c98fa5e78c7bc9e1475b1db603fca560.tar.gz
qemu-45942c08c98fa5e78c7bc9e1475b1db603fca560.tar.bz2
Revert "Revert "linux-user: Run multi-threaded code on a single core""refs/changes/73/53773/1
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.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c
index 84193ce..52885ab 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);