Received: from eggs.gnu.org ([2001:4830:134:3::10]:43013) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c4sJo-0007wR-3t for qemu-devel@nongnu.org; Thu, 10 Nov 2016 11:35:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c4sJl-0005YR-28 for qemu-devel@nongnu.org; Thu, 10 Nov 2016 11:35:16 -0500 Received: from mail-wm0-x22c.google.com ([2a00:1450:400c:c09::22c]:36878) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c4sJk-0005Xk-Ro for qemu-devel@nongnu.org; Thu, 10 Nov 2016 11:35:12 -0500 Received: by mail-wm0-x22c.google.com with SMTP id t79so42789726wmt.0 for ; Thu, 10 Nov 2016 08:35:12 -0800 (PST) Sender: Richard Henderson References: <20161109145748.27282-1-alex.bennee@linaro.org> <20161109145748.27282-9-alex.bennee@linaro.org> From: Richard Henderson Message-ID: <042fbd23-255e-1fb9-3990-708d4ad0bda1@twiddle.net> Date: Thu, 10 Nov 2016 17:35:05 +0100 MIME-Version: 1.0 In-Reply-To: <20161109145748.27282-9-alex.bennee@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH v6 08/19] tcg: enable thread-per-vCPU List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Alex_Benn=c3=a9e?= , pbonzini@redhat.com Cc: qemu-devel@nongnu.org, mttcg@greensocs.com, fred.konrad@greensocs.com, a.rigo@virtualopensystems.com, cota@braap.org, bobby.prani@gmail.com, nikunj@linux.vnet.ibm.com, mark.burton@greensocs.com, jan.kiszka@siemens.com, serge.fdrv@gmail.com, peter.maydell@linaro.org, claudio.fontana@huawei.com, Peter Crosthwaite On 11/09/2016 03:57 PM, Alex Bennée wrote: > + if (qemu_tcg_mttcg_enabled() || !single_tcg_cpu_thread) { > + parallel_cpus = true; Why are we setting this here, > cpu->thread = g_malloc0(sizeof(QemuThread)); > cpu->halt_cond = g_malloc0(sizeof(QemuCond)); > qemu_cond_init(cpu->halt_cond); > + > + if (qemu_tcg_mttcg_enabled()) { > + /* create a thread per vCPU with TCG (MTTCG) */ and not here? > + snprintf(thread_name, VCPU_THREAD_NAME_SIZE, "CPU %d/TCG", > cpu->cpu_index); > - qemu_thread_create(cpu->thread, thread_name, qemu_tcg_cpu_thread_fn, > - cpu, QEMU_THREAD_JOINABLE); > + > + qemu_thread_create(cpu->thread, thread_name, qemu_tcg_cpu_thread_fn, > + cpu, QEMU_THREAD_JOINABLE); > + > + } else { > + /* share a single thread for all cpus with TCG */ > + snprintf(thread_name, VCPU_THREAD_NAME_SIZE, "ALL CPUs/TCG"); > + qemu_thread_create(cpu->thread, thread_name, Otherwise, Reviewed-by: Richard Henderson r~