From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mgqk3-0002bN-SH for qemu-devel@nongnu.org; Thu, 27 Aug 2009 21:59:03 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Mgqjz-0002ah-C1 for qemu-devel@nongnu.org; Thu, 27 Aug 2009 21:59:03 -0400 Received: from [199.232.76.173] (port=44421 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Mgqjz-0002ae-6T for qemu-devel@nongnu.org; Thu, 27 Aug 2009 21:58:59 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40142) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Mgqjy-0002ML-LV for qemu-devel@nongnu.org; Thu, 27 Aug 2009 21:58:58 -0400 Date: Thu, 27 Aug 2009 22:58:54 -0300 From: Glauber Costa Message-ID: <20090828015854.GG5746@mothafucka.localdomain> References: <1247781328-17249-1-git-send-email-glommer@redhat.com> <4A96BF30.7090200@siemens.com> <20090828011856.GE5746@mothafucka.localdomain> <4A973530.4040002@us.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4A973530.4040002@us.ibm.com> Subject: [Qemu-devel] Re: [PATCH v3] introduce on_vcpu List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Jan Kiszka , qemu-devel@nongnu.org, avi@redhat.com On Thu, Aug 27, 2009 at 08:38:56PM -0500, Anthony Liguori wrote: > Glauber Costa wrote: >> qemu-kvm uses a TLS variable for that, to guarantee that we're in the same thread >> as our calling context. I like this idea. if we have io-thread disabled, we're always >> in the same thread, and will always execute the function directly as we used to do >> before on_vcpu(). >> >> I do however remember anthony bending towards issuing a gettid() instead of using >> a TLS var. I'm fine with both. Anthony, avi, you guys have a word here? >> > > Since we already keep the tid in the vcpu structure, it seems to make > more sense to ask "am I this vcpu thread" by doing gettid() == env->tid > than by maintaining a new global tls variable. Actually, we don't. qemu-kvm does, but not qemu. There's, however, a 'host_tid' field used by linux-user that I intend to hijack for that. It is one of the patches I have queued up.