From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MRYbr-0002C0-Vy for qemu-devel@nongnu.org; Thu, 16 Jul 2009 17:35:24 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MRYbn-0002Au-8R for qemu-devel@nongnu.org; Thu, 16 Jul 2009 17:35:23 -0400 Received: from [199.232.76.173] (port=59564 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MRYbn-0002Ar-26 for qemu-devel@nongnu.org; Thu, 16 Jul 2009 17:35:19 -0400 Received: from e36.co.us.ibm.com ([32.97.110.154]:57735) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MRYbm-0000e5-Lt for qemu-devel@nongnu.org; Thu, 16 Jul 2009 17:35:18 -0400 Received: from d03relay04.boulder.ibm.com (d03relay04.boulder.ibm.com [9.17.195.106]) by e36.co.us.ibm.com (8.13.1/8.13.1) with ESMTP id n6GLXcdj029266 for ; Thu, 16 Jul 2009 15:33:38 -0600 Received: from d03av03.boulder.ibm.com (d03av03.boulder.ibm.com [9.17.195.169]) by d03relay04.boulder.ibm.com (8.13.8/8.13.8/NCO v9.2) with ESMTP id n6GLZCbC203586 for ; Thu, 16 Jul 2009 15:35:12 -0600 Received: from d03av03.boulder.ibm.com (loopback [127.0.0.1]) by d03av03.boulder.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id n6GLZCDG030626 for ; Thu, 16 Jul 2009 15:35:12 -0600 Message-ID: <4A5F9D0F.6030906@us.ibm.com> Date: Thu, 16 Jul 2009 16:35:11 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] introduce on_vcpu References: <1247590068-565-1-git-send-email-glommer@redhat.com> <4A5F997A.5070508@codemonkey.ws> <20090716212943.GA4019@poweredge.glommer> <4A5F9AB8.5060206@codemonkey.ws> <20090716213520.GB4019@poweredge.glommer> In-Reply-To: <20090716213520.GB4019@poweredge.glommer> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Glauber Costa Cc: Jan Kiszka , qemu-devel@nongnu.org Glauber Costa wrote: > On Thu, Jul 16, 2009 at 04:25:12PM -0500, Anthony Liguori wrote: > >> Glauber Costa wrote: >> >>> Yes. Purpose of using curren_env was just to make it look more like qemu-kvm >>> But I do understand that we'll have to change it anyway for this code to >>> have any actual value, so I'm fine with using cpu_single_env. >>> >>> >> Yeah, if qemu-kvm is introduce another global current CPUState variable, >> then the qemu-kvm code has to change :-) >> >> Since qemu-kvm keeps a thread id in CPUState, it would make more sense >> to check whether gettid() == env->thread_id, no? >> > disagree. > gettid involves a syscall. You're prematurely optimizing. a gettid syscall likely costs around 150-200 cycles. > current_env in qemu-kvm is a TLS variable. > probably much cheaper. > > > -- Regards, Anthony Liguori