From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36314) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXnrD-0007QW-VE for qemu-devel@nongnu.org; Fri, 04 Sep 2015 06:04:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZXnrA-0001C2-OH for qemu-devel@nongnu.org; Fri, 04 Sep 2015 06:04:31 -0400 Received: from mail-wi0-x235.google.com ([2a00:1450:400c:c05::235]:37140) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXnrA-0001By-HJ for qemu-devel@nongnu.org; Fri, 04 Sep 2015 06:04:28 -0400 Received: by wicfx3 with SMTP id fx3so12419156wic.0 for ; Fri, 04 Sep 2015 03:04:27 -0700 (PDT) Sender: Paolo Bonzini References: <1440375847-17603-1-git-send-email-cota@braap.org> <1440375847-17603-27-git-send-email-cota@braap.org> <55E95B44.3060506@redhat.com> From: Paolo Bonzini Message-ID: <55E96CB1.70209@redhat.com> Date: Fri, 4 Sep 2015 12:04:33 +0200 MIME-Version: 1.0 In-Reply-To: <55E95B44.3060506@redhat.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC 26/38] cpu: protect tb_jmp_cache with seqlock List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Emilio G. Cota" , qemu-devel@nongnu.org, mttcg@listserver.greensocs.com Cc: guillaume.delbergue@greensocs.com, mark.burton@greensocs.com, alex.bennee@linaro.org, a.rigo@virtualopensystems.com, Frederic Konrad On 04/09/2015 10:50, Paolo Bonzini wrote: > Having now reviewed the patch, I think we can do better. > > The idea is: > > - only the CPU thread can set cpu->tb_jmp_cache[] > > - other threads can, under seqlock protection, _clear_ cpu->tb_jmp_cache[] > > - the seqlock can be protected by tb_lock. Then you need not retry the > read, you can just fall back to the slow path, which will take the > tb_lock and thus serialize with the clearer. ... and then we're back to the idea of making tb_invalidated_flag per-TB. :) Paolo