All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Jan Beulich" <jbeulich@novell.com>
To: Keir Fraser <keir@xensource.com>
Cc: xen-devel@lists.xensource.com
Subject: Re: performance counters
Date: Thu, 15 Mar 2007 14:37:33 +0000	[thread overview]
Message-ID: <45F9683D.76E4.0078.0@novell.com> (raw)
In-Reply-To: <C21F0244.B8C9%keir@xensource.com>

>>> Keir Fraser <keir@xensource.com> 15.03.07 15:01 >>>
>On 15/3/07 13:57, "Jan Beulich" <jbeulich@novell.com> wrote:
>
>>> Well, they shouldn't be. Nearly all (apart from the array/histogram ones)
>>> are per-cpu anyway. And even if they weren't, a few lost increments wouldn't
>>> matter (assuming the read and write parts of the increment are each
>>> themselves atomic -- otherwise you could get worse write-conflict problems
>>> like word tearing).
>> 
>> Hmm, I wouldn't want to do away with the atomicity here altogether. That,
>> however, would imply adding knowledge about the field name of the atomic_t
>> to include/xen/perfc.h (and hence imply that all architectures use the same
>> name here). Would you consider this acceptable?
>
>Why is that? Every type of perfcounter (per-cpu, per-array, etc) has its own
>declaration macro. You could change just the ones you want to be non-atomic
>to 'unsigned int'. I'd be very much for getting rid of atomicity altogether,

Because that would require re-writing xen/common/perfc.c, which currently
assumes all 'struct perfcounter' members are of type atomic_t. Of course one
could also use ugly __typeof__ trickery to obtain the type of the field of atomic_t.

>at least on architectures where we know the resulting incorrectness is not
>'too bad' (that includes x86). Some of the shared counters are on hot paths.
>Alternatively we could make *all* counters per-cpu, even histogram counter
>arrays.

To me that would seem like the better alternative than dropping atomicity.

Jan

  reply	other threads:[~2007-03-15 14:37 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-15 11:27 performance counters Jan Beulich
2007-03-15 11:58 ` Keir Fraser
2007-03-15 13:57   ` Jan Beulich
2007-03-15 14:01     ` Keir Fraser
2007-03-15 14:37       ` Jan Beulich [this message]
2007-03-15 15:03         ` Keir Fraser
2007-03-16  8:17           ` Jan Beulich
2007-03-16  8:21             ` Keir Fraser
2007-03-23  1:56 ` question about machine-to-physic table and phy-to-machine table tgh
2007-03-23 11:44   ` Daniel Stodden
2007-03-26  1:39     ` tgh
2007-03-27  4:14   ` Mark Williamson
2007-03-27  6:14     ` tgh

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=45F9683D.76E4.0078.0@novell.com \
    --to=jbeulich@novell.com \
    --cc=keir@xensource.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.