From: Juergen Gross <juergen.gross@ts.fujitsu.com>
To: Keir Fraser <keir.fraser@eu.citrix.com>
Cc: "xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [Patch] support of lock profiling in Xen
Date: Thu, 08 Oct 2009 10:27:38 +0200 [thread overview]
Message-ID: <4ACDA27A.80603@ts.fujitsu.com> (raw)
In-Reply-To: <C6F35E30.16D85%keir.fraser@eu.citrix.com>
Keir Fraser wrote:
> On 08/10/2009 08:48, "Juergen Gross" <juergen.gross@ts.fujitsu.com> wrote:
>
>> I'm not completely satisfied with the solution for the dynamically initialized
>> locks, but I had no better idea in the first run.
>> Another enhancement would be to expand the profiling to rw-locks as well, but
>> this would have required a rewrite of the lock routines using try_lock like
>> for spinlocks. I could do this if the lock profiling is accepted.
>>
>> Comments welcome :-)
>
> The method of chaining and initialising the info is kind of icky. Requiring
> users to unchain dynamic locks is just asking for this support to be
> perpetually broken, or be used only for static locks.
>
> How about defining new initialisers DEFINE_NAMED_SPINLOCK() and
> named_spinlock_init(). This would indicate you consider a lock important
> enough to name (and hence profile) and also categorise dynamically-allocated
> locks, causing their stats to be aggregated (after all, lock optimisations
> will have aggregate effect across all locks of that category).
>
> If lock profiling is compiled in, have a static array of lock-profile
> descriptors (keeps things simple - could make it a growable array, or
> something). On lock init, walk the array looking for that name. If found,
> write the entry index into a new field in the spinlock struct. If not found,
> allocate next entry in lock-profile array, init it, and write its index into
> the spinlock struct.
Don't you think a solution like for performance counters would be better then?
The index would be in a header file and the sums could be held per-cpu to
avoid races.
It would even be possible to define lock arrays if summing up all data for
e.g. domain specific locks is not desired.
>
> On lock operations, if the index field in the spinlock is non-zero, update
> stats in the associated profile structure. Regarding races from locks
> aliasing to the same profile structure -- either assume that doesn't matter
> much, or perhaps update fields with atomic ops.
Juergen
--
Juergen Gross Principal Developer Operating Systems
TSP ES&S SWE OS6 Telephone: +49 (0) 89 636 47950
Fujitsu Technolgy Solutions e-mail: juergen.gross@ts.fujitsu.com
Otto-Hahn-Ring 6 Internet: ts.fujitsu.com
D-81739 Muenchen Company details: ts.fujitsu.com/imprint.html
next prev parent reply other threads:[~2009-10-08 8:27 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-08 7:48 [Patch] support of lock profiling in Xen Juergen Gross
2009-10-08 8:15 ` Keir Fraser
2009-10-08 8:27 ` Juergen Gross [this message]
2009-10-08 8:38 ` Keir Fraser
2009-10-08 8:40 ` Keir Fraser
2009-10-08 9:04 ` Juergen Gross
2009-10-08 9:21 ` Keir Fraser
2009-10-08 9:35 ` Juergen Gross
2009-10-08 9:47 ` Keir Fraser
2009-10-09 8:27 ` Juergen Gross
2009-10-09 9:22 ` Keir Fraser
2009-10-13 13:56 ` Juergen Gross
2009-10-13 15:49 ` Keir Fraser
2009-10-08 8:21 ` Keir Fraser
2009-10-08 8:38 ` Juergen Gross
2009-10-08 9:17 ` Keir Fraser
2009-10-09 10:35 ` George Dunlap
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4ACDA27A.80603@ts.fujitsu.com \
--to=juergen.gross@ts.fujitsu.com \
--cc=keir.fraser@eu.citrix.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.