qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v3 4/5] qom: replace object property list with G


From: Eric Blake
Subject: Re: [Qemu-devel] [PATCH v3 4/5] qom: replace object property list with GHashTable
Date: Thu, 8 Oct 2015 13:13:09 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 10/08/2015 08:09 AM, Daniel P. Berrange wrote:
> From: Pavel Fedin <address@hidden>
> 
> 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 <address@hidden>
> ---
>  include/qom/object.h | 10 ++++--
>  qom/object.c         | 94 
> +++++++++++++++++++++++++++++++---------------------
>  2 files changed, 63 insertions(+), 41 deletions(-)
> 
> @@ -879,13 +898,11 @@ object_property_add(Object *obj, const char *name, 
> const char *type,
>          return ret;
>      }
>  
> -    QTAILQ_FOREACH(prop, &obj->properties, node) {
> -        if (strcmp(prop->name, name) == 0) {
> -            error_setg(errp, "attempt to add duplicate property '%s'"
> +    if (g_hash_table_contains(obj->properties, name)) {
> +        error_setg(errp, "attempt to add duplicate property '%s'"
>                         " to object (type '%s')", name,
>                         object_get_typename(obj));

Indentation is now off on the unchanged lines.

Reviewed-by: Eric Blake <address@hidden>

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]