From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:42464) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQsG3-0006Da-14 for qemu-devel@nongnu.org; Wed, 24 Oct 2012 00:07:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TQsG1-0005cx-SJ for qemu-devel@nongnu.org; Wed, 24 Oct 2012 00:07:54 -0400 Received: from mailout3.w1.samsung.com ([210.118.77.13]:15961) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TQsG1-0005cr-MK for qemu-devel@nongnu.org; Wed, 24 Oct 2012 00:07:53 -0400 Received: from eusync4.samsung.com (mailout3.w1.samsung.com [210.118.77.13]) by mailout3.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MCD008AWQ5U1G50@mailout3.w1.samsung.com> for qemu-devel@nongnu.org; Wed, 24 Oct 2012 05:08:18 +0100 (BST) Received: from [106.109.8.9] by eusync4.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0MCD00EE7Q4XH360@eusync4.samsung.com> for qemu-devel@nongnu.org; Wed, 24 Oct 2012 05:07:50 +0100 (BST) Message-id: <50876990.2010209@samsung.com> Date: Wed, 24 Oct 2012 08:07:44 +0400 From: Evgeny Voevodin MIME-version: 1.0 References: <1350973278-2236-1-git-send-email-e.voevodin@samsung.com> <1350973278-2236-3-git-send-email-e.voevodin@samsung.com> <508709B7.7090503@twiddle.net> In-reply-to: <508709B7.7090503@twiddle.net> Content-type: text/plain; charset=UTF-8; format=flowed Content-transfer-encoding: 7bit Subject: Re: [Qemu-devel] [PATCH v2 2/7] translate-all.c: Introduce TCGContext *tcg_cur_ctx List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Richard Henderson Cc: qemu-devel@nongnu.org, blauwirbel@gmail.com, kyungmin.park@samsung.com, edgar.iglesias@gmail.com, aurelien@aurel32.net On 10/24/2012 01:18 AM, Richard Henderson wrote: > On 2012-10-23 16:21, Evgeny Voevodin wrote: >> We will use this pointer from functions where we don't have an >> interface to pass tcg_ctx as a parameter. > I don't think this is worthwhile. It'll just make the whole thing slower, > passing around unnecessary pointers. > > > r~ > 1. I didn't noticed any slow-down of kernel boot process. Maybe it's worth to make more tests with self modifying code but I don't think so, because 2. The most intensive usage of tcg_cur_ctx is in tcg/tcg-op.h functions. If we look carefully at them then we will see that there are only few functions for which single excessive dereferencing of a pointer leads to any significant slow-down. These functions are those which make just one or two operations and exit. And we should keep in mind that there is only single dereference of a pointer since it is stored in the register for further operations. Of course some slow-down should present but I found it negligible (actually I didn't find it at all). If there are some common tests for TCG generation speed I can try to run them and report results. Also we can specify tcg_cur_ctx as const and in that case I guess that dereferencing of tcg_cur_ctx should not lead to any slow-down. Also I can drop tcg_cur_ctx and use tcg_ctx.xxx instead as was in the first series. What about the rest patches? -- Kind regards, Evgeny Voevodin, Technical Leader, Mobile Group, Samsung Moscow Research Center, e-mail: e.voevodin@samsung.com