From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Mguna-0005Fr-Ld for qemu-devel@nongnu.org; Fri, 28 Aug 2009 02:18:58 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MgunV-0005BK-Ek for qemu-devel@nongnu.org; Fri, 28 Aug 2009 02:18:57 -0400 Received: from [199.232.76.173] (port=46173 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MgunV-0005Am-1c for qemu-devel@nongnu.org; Fri, 28 Aug 2009 02:18:53 -0400 Received: from mx20.gnu.org ([199.232.41.8]:29909) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MgunU-00053A-Ka for qemu-devel@nongnu.org; Fri, 28 Aug 2009 02:18:52 -0400 Received: from mx1.redhat.com ([209.132.183.28]) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MgunS-00022t-G3 for qemu-devel@nongnu.org; Fri, 28 Aug 2009 02:18:50 -0400 Date: Fri, 28 Aug 2009 09:18:47 +0300 From: Gleb Natapov Subject: Re: [Qemu-devel] Re: [PATCH v3] introduce on_vcpu Message-ID: <20090828061846.GA22585@redhat.com> 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> List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Jan Kiszka , Glauber Costa , 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. > What is the problem with tls variables? Why do unneeded system call? -- Gleb.