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

Re: [Xen-devel] [PATCH 4/4] xen: modify lock profiling interface


  • To: Juergen Gross <JGross@xxxxxxxx>
  • From: Jan Beulich <JBeulich@xxxxxxxx>
  • Date: Thu, 8 Aug 2019 07:32:38 +0000
  • Accept-language: en-US
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=uFrNth/oouxfCYvhj47C2w3mpx5PLct9qNk5pEeKYRw=; b=gMKF/54dlW0JswOR+1Mo4/i+z4IC5NUh45vyP2W0ExdbEpKmWzRYGakQtEZJ0dzvfTrFCPa/q8tbmw4it3apQPjCADUoYn5mv13yXOfNq5GNyLoJxRddjVO8Cmkc1jx+cu16jA2NtgTaOhZMOdc1ttEASV58i479PbkRqrWg0GBgqF1PLMR3+omDDB1OSpbCFH5phuwDy81YFjMWkvhQ56ChE+bJWXsmuGlW70jXGbxR+cslV0+PUNqbpnCZhbK72saRKEZT1s0W3WBgQcOPNXRW+BN54+F2N0sUxnX6jBLD6VA2eRn3D8ADInpqFXkUQJy950huBTLHZvphobxj5g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kx1krN1rw1uSMGzopVY/XYsaoHg1qwJjMvPKRnsrg0lUCHj7UNKAUJgpvISJjF3P+FR4eV9OLjNefs0OrD707Hs9JKFHAGqyn7SQ+CAo03H9R52Ssuvb5hDbCALOCEPzlu8GCGahUwkOuY5KKE2x+YVoXrJ00WYfHEeim/Ry2oX7oX9+rMQRg1XwXAzhdFzPzxGd2ePlGNhnEuxEjWDOswbmOuul2p842uCgjz1nLbPWP2JJexkH5lQfGd9HmxIYT4aE4MhIhZrI8jzDbMFRmO6t76WJm4VydsC0OgEv5zVq1CBScKazNUaB7Cx8hNKU9hdKIB8LqHaknlwVWvYlcA==
  • Authentication-results: spf=none (sender IP is ) smtp.mailfrom=JBeulich@xxxxxxxx;
  • Cc: Stefano Stabellini <sstabellini@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>, George Dunlap <George.Dunlap@xxxxxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Ian Jackson <ian.jackson@xxxxxxxxxxxxx>, Tim Deegan <tim@xxxxxxx>, Julien Grall <julien.grall@xxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 08 Aug 2019 07:36:25 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Thread-index: AQHVTSzYoaxeQnTspU6rE8JBS3hDbqbw3IcA
  • Thread-topic: [PATCH 4/4] xen: modify lock profiling interface

On 07.08.2019 16:31, Juergen Gross wrote:
> @@ -463,31 +464,67 @@ int spinlock_profile_control(struct 
> xen_sysctl_lockprof_op *pc)
>       return rc;
>   }
>   
> -void _lock_profile_register_struct(
> -    int32_t type, struct lock_profile_qhead *qhead, int32_t idx, char *name)
> +static struct lock_profile_anc *find_prof_anc(const char *name)
>   {
> -    qhead->idx = idx;
> +    struct lock_profile_anc *anc;
> +
> +    for ( anc = lock_profile_ancs; anc; anc = anc->next )
> +        if ( !strcmp(anc->name, name) )
> +            return anc;
> +    return NULL;
> +}
> +
> +void _lock_profile_register_struct(struct lock_profile_qhead *qhead,
> +                                   int32_t idx, const char *name)
> +{
> +    struct lock_profile_anc *anc;
> +
>       spin_lock(&lock_profile_lock);
> -    qhead->head_q = lock_profile_ancs[type].head_q;
> -    lock_profile_ancs[type].head_q = qhead;
> -    lock_profile_ancs[type].name = name;
> +
> +    anc = find_prof_anc(name);
> +    if ( !anc )
> +    {
> +        anc = xzalloc(struct lock_profile_anc);
> +        anc->name = name;
> +        anc->next = lock_profile_ancs;
> +        lock_profile_ancs = anc;
> +    }

This is an imo fundamental weakness of the new model: You now
require a dynamic memory allocation (of which you don't even
check that it was successful). Right now the path above will
only be taken at boot time, but that's not stated anywhere as
a restriction (afaics), and hence doesn't need to remain this
way.

Furthermore "name" now serves two purposes when previously it
served just one. This is best noticeable with the function's
use in domain_create(): Previously that set up the class
"per-domain" with an initial instance "struct domain". This
did provide for someone later going and also registering
another per-domain structure (e.g. struct p2m_domain) as
another "per-domain" class instance. Then again maybe I'm not
correctly understanding the original intentions ...

Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.