From patchwork Fri Nov 13 18:14:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 544413 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 0B193141426 for ; Sat, 14 Nov 2015 05:14:30 +1100 (AEDT) Received: from localhost ([::1]:54558 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZxIrk-0007ik-8E for incoming@patchwork.ozlabs.org; Fri, 13 Nov 2015 13:14:28 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40970) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZxIrS-0007ME-6R for qemu-devel@nongnu.org; Fri, 13 Nov 2015 13:14:11 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZxIrO-00066a-3p for qemu-devel@nongnu.org; Fri, 13 Nov 2015 13:14:10 -0500 Received: from mx2.suse.de ([195.135.220.15]:44650) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZxIrN-00064W-Px for qemu-devel@nongnu.org; Fri, 13 Nov 2015 13:14:06 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id C5D8AAD1C; Fri, 13 Nov 2015 18:13:40 +0000 (UTC) To: "Daniel P. Berrange" , qemu-devel@nongnu.org, Pavel Fedin References: <1444739866-14798-1-git-send-email-berrange@redhat.com> <1444739866-14798-7-git-send-email-berrange@redhat.com> From: =?UTF-8?Q?Andreas_F=c3=a4rber?= X-Enigmail-Draft-Status: N1110 Organization: SUSE Linux GmbH Message-ID: <5646286B.2030307@suse.de> Date: Fri, 13 Nov 2015 19:14:03 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <1444739866-14798-7-git-send-email-berrange@redhat.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x (no timestamps) [generic] X-Received-From: 195.135.220.15 Cc: Paolo Bonzini , Markus Armbruster , Christian Borntraeger , Peter Maydell Subject: Re: [Qemu-devel] [PATCH v4 6/7] qom: replace object property list with GHashTable X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Am 13.10.2015 um 14:37 schrieb Daniel P. Berrange: > From: Pavel Fedin > > ARM GICv3 systems with large number of CPUs create lots of IRQ pins. Since > every pin is represented as a property, number of these properties becomes > very large. Every property add first makes sure there's no duplicates. > Traversing the list becomes very slow, therefore qemu initialization takes > significant time (several seconds for e. g. 16 CPUs). > > This patch replaces list with GHashTable, making lookup very fast. The only > drawback is that object_child_foreach() and object_child_foreach_recursive() > cannot modify their objects during traversal, since GHashTableIter does not > have modify-safe version. However, the code seems not to modify objects via > these functions. > > Signed-off-by: Daniel P. Berrange > Signed-off-by: Pavel Fedin (note these seemed misordered) I have queued things up to 6/7 on qom-next: https://github.com/afaerber/qemu-cpu/commits/qom-next This patch didn't apply and I had to hand-apply one hunk (which I double-checked, but you never know). Unfortunately I run into this test failure: TEST: tests/device-introspect-test... (pid=4094) /s390x/device/introspect/list: OK /s390x/device/introspect/none: OK /s390x/device/introspect/abstract: OK /s390x/device/introspect/concrete: (process:4102): GLib-CRITICAL **: g_hash_table_iter_next: assertion 'ri->version == ri->hash_table->version' failed (process:4102): GLib-CRITICAL **: g_hash_table_iter_next: assertion 'ri->version == ri->hash_table->version' failed (process:4102): GLib-CRITICAL **: iter_remove_or_steal: assertion 'ri->version == ri->hash_table->version' failed ** ERROR:/home/andreas/QEMU/qemu/qom/object.c:867:object_unref: assertion failed: (obj->ref > 0) Broken pipe FAIL GTester: last random seed: R02S4fa2068506971129a7ebe2323dbe03b7 (pid=4104) FAIL: tests/device-introspect-test TEST: tests/qom-test... (pid=4105) /s390x/qom/s390-ccw-virtio-2.5: OK /s390x/qom/s390-ccw-virtio-2.4: OK /s390x/qom/none: OK /s390x/qom/s390-virtio: WARNING The s390-virtio machine (non-ccw) is deprecated. It will be removed in 2.6. Please use s390-ccw-virtio OK PASS: tests/qom-test Are you sure you tested all targets? Any hunch where this might stem from? The below patch reveals that the ref count is 0. Might be just a symptom of the actual problem though. Regards, Andreas diff --git a/qom/object.c b/qom/object.c index 0ac3bc1..9aa6159 100644 --- a/qom/object.c +++ b/qom/object.c @@ -864,7 +864,7 @@ void object_unref(Object *obj) if (!obj) { return; } - g_assert(obj->ref > 0); + g_assert_cmpint(obj->ref, >, 0); /* parent always holds a reference to its children */ if (atomic_fetch_dec(&obj->ref) == 1) {