Received: from eggs.gnu.org ([2001:4830:134:3::10]:56499) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1baJ29-0003T7-58 for qemu-devel@nongnu.org; Thu, 18 Aug 2016 04:50:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1baJ28-0000YK-99 for qemu-devel@nongnu.org; Thu, 18 Aug 2016 04:50:41 -0400 References: <1471348968-4614-1-git-send-email-vijay.kilari@gmail.com> <1471348968-4614-2-git-send-email-vijay.kilari@gmail.com> <151e49bd-d79d-0035-c775-86be29df3ac2@redhat.com> From: Paolo Bonzini Message-ID: <59517fd9-049c-adfc-5793-68165fe87f34@redhat.com> Date: Thu, 18 Aug 2016 10:50:30 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [RFC PATCH v2 1/2] utils: Add helper to read arm MIDR_EL1 register List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Vijay Kilari Cc: qemu-arm , Peter Maydell , Richard Henderson , Pavel Fedin , QEMU Developers , "prasun.kapoor" , Vijaya Kumar K On 18/08/2016 09:56, Vijay Kilari wrote: > The get_aarch_cpu_id() has check " if (unlikely(!cpu_info_read)) ". > If we call get_aarch_cpu_id() from is_thunderx_pass2_cpu() which is > called from inside the loop, we will be adding one additional check. On the other hand, you are making an assumption that the caller of is_thunderx_pass2_cpu() calls get_aarch64_cpu_id() first, and not documenting it anywhere. And given that you shouldn't call _any_ function from inside such a hot loop, your solution is inferior on both counts. Paolo > What I observed is having extra check inside the loop is adding 100 to > 200ms overhead > on live migration time. So I added this variable extra is_thunderx_cpu > static variable > to make it simple single check.