From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48712) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUN2b-0003vB-Qt for qemu-devel@nongnu.org; Tue, 25 Aug 2015 18:50:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZUN2Y-0008DV-M9 for qemu-devel@nongnu.org; Tue, 25 Aug 2015 18:50:05 -0400 Received: from mx5-phx2.redhat.com ([209.132.183.37]:34973) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZUN2Y-0008Bv-Fe for qemu-devel@nongnu.org; Tue, 25 Aug 2015 18:50:02 -0400 Date: Tue, 25 Aug 2015 18:49:54 -0400 (EDT) From: Paolo Bonzini Message-ID: <1946112780.18984680.1440542994335.JavaMail.zimbra@redhat.com> In-Reply-To: <20150825214626.GD29063@flamenco> References: <1440375847-17603-1-git-send-email-cota@braap.org> <1440375847-17603-27-git-send-email-cota@braap.org> <55DA7012.40801@redhat.com> <20150825214626.GD29063@flamenco> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 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" Cc: mttcg@greensocs.com, mark burton , a rigo , qemu-devel@nongnu.org, guillaume delbergue , alex bennee , Frederic Konrad > The seqlock for tb_jmp_cache is necessary the moment that the > array can be wiped out with a memset(), as shown above. That > function (tb_flush_jmp_cache) is called by tlb_flush_page, > which has many callers. > > One could argue that we could enforce calling tlb_flush_page to be > a) always done by the owner thread or b) done while all others CPUs > are paused. > > I argue that worrying about that is not worth it; let's protect > the array with a seqlock, which on TSO is essentially free, and > worry about more important things. Got it, this makes sense. Paolo > Wrt the next two patches: > > Patch 27 is an improvement in that each TB has its own valid flag, > which makes sense because this should only affect TB's that are > trying to chain to/from it, not all TBs. > > Patch 28 uses the RCU QLIST which to me seems cleaner and less > error-prone than open-coding an RCU LIST. > > Thanks, > > Emilio >