From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46233) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c4sUk-0000ch-HR for qemu-devel@nongnu.org; Thu, 10 Nov 2016 11:46:35 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c4sUf-0003oS-TD for qemu-devel@nongnu.org; Thu, 10 Nov 2016 11:46:34 -0500 Received: from mail-wm0-x236.google.com ([2a00:1450:400c:c09::236]:38618) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c4sUf-0003nw-Lg for qemu-devel@nongnu.org; Thu, 10 Nov 2016 11:46:29 -0500 Received: by mail-wm0-x236.google.com with SMTP id f82so43474601wmf.1 for ; Thu, 10 Nov 2016 08:46:29 -0800 (PST) References: <20161109145748.27282-1-alex.bennee@linaro.org> <20161109145748.27282-9-alex.bennee@linaro.org> <042fbd23-255e-1fb9-3990-708d4ad0bda1@twiddle.net> From: Alex =?utf-8?Q?Benn=C3=A9e?= In-reply-to: <042fbd23-255e-1fb9-3990-708d4ad0bda1@twiddle.net> Date: Thu, 10 Nov 2016 16:46:26 +0000 Message-ID: <87d1i38eql.fsf@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 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: Richard Henderson Cc: pbonzini@redhat.com, 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 Richard Henderson writes: > 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? Good point, I'll fix that. > >> + 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~ -- Alex Bennée