From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49877) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bJ7iZ-0005VY-KE for qemu-devel@nongnu.org; Fri, 01 Jul 2016 19:19:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bJ7iV-0004Vl-Dv for qemu-devel@nongnu.org; Fri, 01 Jul 2016 19:19:26 -0400 Received: from mail-qk0-x243.google.com ([2607:f8b0:400d:c09::243]:32992) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bJ7iV-0004Vg-9I for qemu-devel@nongnu.org; Fri, 01 Jul 2016 19:19:23 -0400 Received: by mail-qk0-x243.google.com with SMTP id n132so26757594qka.0 for ; Fri, 01 Jul 2016 16:19:23 -0700 (PDT) Sender: Richard Henderson References: <1467389770-9738-1-git-send-email-alex.bennee@linaro.org> <1467389770-9738-3-git-send-email-alex.bennee@linaro.org> From: Richard Henderson Message-ID: <63156a28-c154-b86c-bd2d-5487fb8ffd27@twiddle.net> Date: Fri, 1 Jul 2016 16:19:19 -0700 MIME-Version: 1.0 In-Reply-To: <1467389770-9738-3-git-send-email-alex.bennee@linaro.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH 2/2] cpu-exec: remove tb_lock from the hot-path List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: =?UTF-8?Q?Alex_Benn=c3=a9e?= , mttcg@greensocs.com, qemu-devel@nongnu.org, fred.konrad@greensocs.com, a.rigo@virtualopensystems.com, serge.fdrv@gmail.com, cota@braap.org, bobby.prani@gmail.com Cc: mark.burton@greensocs.com, pbonzini@redhat.com, jan.kiszka@siemens.com, peter.maydell@linaro.org, claudio.fontana@huawei.com, Peter Crosthwaite On 07/01/2016 09:16 AM, Alex Bennée wrote: > Lock contention in the hot path of moving between existing patched > TranslationBlocks is the main drag in multithreaded performance. This > patch pushes the tb_lock() usage down to the two places that really need > it: > > - code generation (tb_gen_code) > - jump patching (tb_add_jump) > > The rest of the code doesn't really need to hold a lock as it is either > using per-CPU structures, atomically updated or designed to be used in > concurrent read situations (qht_lookup). > > To keep things simple I removed the #ifdef CONFIG_USER_ONLY stuff as the > locks become NOPs anyway until the MTTCG work is completed. > > Signed-off-by: Alex Bennée > > --- > v3 > - fix merge conflicts with Sergey's patch > v4 > - revert name tweaking > - drop test jmp_list_next outside lock > - mention lock NOPs in comments > --- > cpu-exec.c | 49 ++++++++++++++++++++++--------------------------- > 1 file changed, 22 insertions(+), 27 deletions(-) Reviewed-by: Richard Henderson r~