Received: from eggs.gnu.org ([208.118.235.92]:58911) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uaoas-0000Rn-9V for qemu-devel@nongnu.org; Fri, 10 May 2013 10:46:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Uaoaq-00031s-PT for qemu-devel@nongnu.org; Fri, 10 May 2013 10:46:46 -0400 Received: from hall.aurel32.net ([2001:470:1f15:c4f::1]:40573) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Uaoaq-00031l-Ig for qemu-devel@nongnu.org; Fri, 10 May 2013 10:46:44 -0400 Date: Fri, 10 May 2013 16:46:42 +0200 From: Aurelien Jarno Message-ID: <20130510144642.GK31148@hall.aurel32.net> References: <1368188203-3407-1-git-send-email-pbonzini@redhat.com> <874nebdm4r.fsf@codemonkey.ws> <518CF130.2030402@redhat.com> <874neazz8v.fsf@codemonkey.ws> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <874neazz8v.fsf@codemonkey.ws> Sender: Aurelien Jarno Subject: Re: [Qemu-devel] [PATCH for-1.5 0/9] Disable expensive QOM cast debugging for official releases List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Paolo Bonzini , mst@redhat.com, qemu-devel@nongnu.org, Andreas Faerber On Fri, May 10, 2013 at 09:27:28AM -0500, Anthony Liguori wrote: > Paolo Bonzini writes: > > > Il 10/05/2013 15:01, Anthony Liguori ha scritto: > >> Paolo Bonzini writes: > >> > >>> Cast debugging can have a substantial cost (20% or more, measured by > >>> Aurelien on qemu-system-ppc64). > >> > >> [Needs citation] > > > > Sure: http://permalink.gmane.org/gmane.comp.emulators.qemu/210830 > > > > 49,73% perf-10672.map [.] 0x7f7853ab4e0f > > 13,23% qemu-system-ppc64 [.] cpu_ppc_exec > > 13,16% libglib-2.0.so.0.3200.4 [.] g_hash_table_lookup > > 8,18% libglib-2.0.so.0.3200.4 [.] g_str_hash > > 2,47% qemu-system-ppc64 [.] object_class_dynamic_cast > > 1,97% qemu-system-ppc64 [.] type_is_ancestor > > 1,05% libglib-2.0.so.0.3200.4 [.] g_str_equal > > > > That's ~27%. > > > >>> Instead of adding special-cased "fast > >>> casts" in the hot paths, we can just disable it in releases. At the > >>> same time, add tracing facilities that simplify the analysys of those > >>> problems that cast debugging would reveal. > >> > >> I'd prefer not to disable but instead focus on improving performance. > > > > For 1.5? This is a regression in 1.5 due to more and more usage of > > foo_env_on_cpu. > > If this is a regression, then we should be able to show: > > 1) workload XYZ gets X in 1.4 and Y in 1.5 > > 2) applying your series demonstrates that we go back to X performance I will work on that. > I'm not convinced this is a true set of statements. 13% of time spent > doing casts could simply suggest that the vcpu is largely idle and has > nothing better to do. It's not in KVM, but in the QEMU case. The emulated CPU was fully loaded during this perf trace, and the qemu-system-ppc64 process was taking about 100% of the host CPU. This means that this 13% of the time doing cast can be used to emulate more instructions. > At any rate, given (1), we can at least try some other less invasive > approachs to fixing the problem. Just removing the unnecessary cast > might end up doing it. We have changed a pointer access in a hot path (and more are likely to come as far as I know) to a complex function. The correct way to fix that is to remove the complex function. -- Aurelien Jarno GPG: 1024D/F1BCDB73 aurelien@aurel32.net http://www.aurel32.net