From 6562e78b5d324db0eff4aaf6abd154f7ef4acd7f192686bd5015b710f3b420e0 Mon Sep 17 00:00:00 2001 From: Alexander Graf Date: Wed, 14 Jan 2015 00:42:12 +0000 Subject: [PATCH] Accepting request 281071 from home:algraf:branches:Virtualization Fix 32bit ARM build hosts running out of memory all the time. - Patch queue updated from git://github.com/openSUSE/qemu.git opensuse-2.2 * Patches added: 0037-AIO-Reduce-number-of-threads-for-32.patch - Patch queue updated from git://github.com/openSUSE/qemu.git opensuse-2.2 * Patches added: 0037-AIO-Reduce-number-of-threads-for-32.patch - Patch queue updated from git://github.com/openSUSE/qemu.git opensuse-2.2 * Patches added: 0037-AIO-Reduce-number-of-threads-for-32.patch OBS-URL: https://build.opensuse.org/request/show/281071 OBS-URL: https://build.opensuse.org/package/show/Virtualization/qemu?expand=0&rev=233 --- ...-AIO-Reduce-number-of-threads-for-32.patch | 40 +++++++++++++++++++ libcacard.changes | 7 ++++ libcacard.spec | 2 + qemu-linux-user.changes | 7 ++++ qemu-linux-user.spec | 2 + qemu.changes | 7 ++++ qemu.spec | 2 + 7 files changed, 67 insertions(+) create mode 100644 0037-AIO-Reduce-number-of-threads-for-32.patch diff --git a/0037-AIO-Reduce-number-of-threads-for-32.patch b/0037-AIO-Reduce-number-of-threads-for-32.patch new file mode 100644 index 00000000..ec47ca73 --- /dev/null +++ b/0037-AIO-Reduce-number-of-threads-for-32.patch @@ -0,0 +1,40 @@ +From c464e8e38da71cbc136ea2cf6fbf5bddfc25e7d5 Mon Sep 17 00:00:00 2001 +From: Alexander Graf +Date: Wed, 14 Jan 2015 01:32:11 +0100 +Subject: [PATCH] AIO: Reduce number of threads for 32bit hosts + +On hosts with limited virtual address space (32bit pointers), we can very +easily run out of virtual memory with big thread pools. + +Instead, we should limit ourselves to small pools to keep memory footprint +low on those systems. + +This patch fixes random VM stalls like + + (process:25114): GLib-ERROR **: gmem.c:103: failed to allocate 1048576 bytes + +on 32bit ARM systems for me. + +Signed-off-by: Alexander Graf +--- + thread-pool.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/thread-pool.c b/thread-pool.c +index e2cac8e..87a3ea9 100644 +--- a/thread-pool.c ++++ b/thread-pool.c +@@ -299,7 +299,12 @@ static void thread_pool_init_one(ThreadPool *pool, AioContext *ctx) + qemu_mutex_init(&pool->lock); + qemu_cond_init(&pool->worker_stopped); + qemu_sem_init(&pool->sem, 0); +- pool->max_threads = 64; ++ if (sizeof(pool) == 4) { ++ /* 32bit systems run out of virtual memory quickly */ ++ pool->max_threads = 4; ++ } else { ++ pool->max_threads = 64; ++ } + pool->new_thread_bh = aio_bh_new(ctx, spawn_thread_bh_fn, pool); + + QLIST_INIT(&pool->head); diff --git a/libcacard.changes b/libcacard.changes index 33a38abd..b2af417f 100644 --- a/libcacard.changes +++ b/libcacard.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Jan 14 00:38:44 UTC 2015 - agraf@suse.com + +- Patch queue updated from git://github.com/openSUSE/qemu.git opensuse-2.2 +* Patches added: + 0037-AIO-Reduce-number-of-threads-for-32.patch + ------------------------------------------------------------------- Mon Jan 12 14:32:14 UTC 2015 - afaerber@suse.de diff --git a/libcacard.spec b/libcacard.spec index 67060053..554cfaf9 100644 --- a/libcacard.spec +++ b/libcacard.spec @@ -61,6 +61,7 @@ Patch0033: 0033-linux-user-lseek-explicitly-cast-no.patch Patch0034: 0034-virtfs-proxy-helper-Provide-__u64-f.patch Patch0035: 0035-configure-Enable-PIE-for-ppc-and-pp.patch Patch0036: 0036-qtest-Increase-socket-timeout.patch +Patch0037: 0037-AIO-Reduce-number-of-threads-for-32.patch # Please do not add patches manually here, run update_git.sh. # this is to make lint happy Source300: qemu-rpmlintrc @@ -156,6 +157,7 @@ This sub-package contains development files for the Smartcard library. %patch0034 -p1 %patch0035 -p1 %patch0036 -p1 +%patch0037 -p1 %build ./configure --prefix=%_prefix --sysconfdir=%_sysconfdir \ diff --git a/qemu-linux-user.changes b/qemu-linux-user.changes index de9e0487..2a1b6b37 100644 --- a/qemu-linux-user.changes +++ b/qemu-linux-user.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Jan 14 00:38:41 UTC 2015 - agraf@suse.com + +- Patch queue updated from git://github.com/openSUSE/qemu.git opensuse-2.2 +* Patches added: + 0037-AIO-Reduce-number-of-threads-for-32.patch + ------------------------------------------------------------------- Mon Jan 12 14:32:10 UTC 2015 - afaerber@suse.de diff --git a/qemu-linux-user.spec b/qemu-linux-user.spec index f222bef0..b9a7e533 100644 --- a/qemu-linux-user.spec +++ b/qemu-linux-user.spec @@ -61,6 +61,7 @@ Patch0033: 0033-linux-user-lseek-explicitly-cast-no.patch Patch0034: 0034-virtfs-proxy-helper-Provide-__u64-f.patch Patch0035: 0035-configure-Enable-PIE-for-ppc-and-pp.patch Patch0036: 0036-qtest-Increase-socket-timeout.patch +Patch0037: 0037-AIO-Reduce-number-of-threads-for-32.patch # Please do not add patches manually here, run update_git.sh. # this is to make lint happy Source300: qemu-rpmlintrc @@ -150,6 +151,7 @@ run cross-architecture builds. %patch0034 -p1 %patch0035 -p1 %patch0036 -p1 +%patch0037 -p1 %build ./configure --prefix=%_prefix --sysconfdir=%_sysconfdir \ diff --git a/qemu.changes b/qemu.changes index 4b7e4fe0..e0e59ebc 100644 --- a/qemu.changes +++ b/qemu.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Wed Jan 14 00:38:38 UTC 2015 - agraf@suse.com + +- Patch queue updated from git://github.com/openSUSE/qemu.git opensuse-2.2 +* Patches added: + 0037-AIO-Reduce-number-of-threads-for-32.patch + ------------------------------------------------------------------- Mon Jan 12 14:32:06 UTC 2015 - afaerber@suse.de diff --git a/qemu.spec b/qemu.spec index 734e6268..7aecacd4 100644 --- a/qemu.spec +++ b/qemu.spec @@ -91,6 +91,7 @@ Patch0033: 0033-linux-user-lseek-explicitly-cast-no.patch Patch0034: 0034-virtfs-proxy-helper-Provide-__u64-f.patch Patch0035: 0035-configure-Enable-PIE-for-ppc-and-pp.patch Patch0036: 0036-qtest-Increase-socket-timeout.patch +Patch0037: 0037-AIO-Reduce-number-of-threads-for-32.patch # Please do not add patches manually here, run update_git.sh. # this is to make lint happy @@ -497,6 +498,7 @@ This package provides a service file for starting and stopping KSM. %patch0034 -p1 %patch0035 -p1 %patch0036 -p1 +%patch0037 -p1 %if %{build_x86_fw_from_source} # as a safeguard, delete the firmware files that we intend to build