From: Ingo Molnar <mingo@elte.hu>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: akpm@linux-foundation.org, Paul Mackerras <paulus@samba.org>,
linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org
Subject: Re: [PATCH 1/2] lib: Provide generic atomic64_t implementation
Date: Sat, 13 Jun 2009 22:56:11 +0200 [thread overview]
Message-ID: <20090613205611.GA21498@elte.hu> (raw)
In-Reply-To: <alpine.LFD.2.01.0906131323270.3237@localhost.localdomain>
* Linus Torvalds <torvalds@linux-foundation.org> wrote:
> On Sat, 13 Jun 2009, Linus Torvalds wrote:
> >
> > On Sat, 13 Jun 2009, Paul Mackerras wrote:
> > >
> > > Linus, Andrew: OK if this goes in via the powerpc tree?
> >
> > Ok by me.
>
> Btw, do 32-bit architectures really necessarily want 64-bit
> performance counters?
>
> I realize that 32-bit counters will overflow pretty easily, but I
> do wonder about the performance impact of doing things like hashed
> spinlocks for 64-bit counters. Maybe the downsides of 64-bit perf
> counters on such architectures might outweight the upsides?
We account all sorts of non-hw bits via atomic64_t as well - for
example time related counters in nanoseconds - which wrap 32 bits at
4 seconds.
There's also security/stability relevant bits:
counter->id = atomic64_inc_return(&perf_counter_id);
We dont really want that ID to wrap ever - it could create a leaking
of one PMU context into another. (We could rewrite it by putting a
global lock around it, but still - this is a convenient primitive.)
In select places we might be able to reduce the use of atomic64_t
(that might make performance sense anyway) - but to get rid of all
of them would be quite painful. We initially started with a 32-bit
implementation and it was quite painful with fast-paced units.
So since Paul has already coded the wrappers up ... i'd really
prefer that, unless there's really compelling reasons not to do it.
Ingo
next prev parent reply other threads:[~2009-06-13 21:11 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-13 7:10 [PATCH 1/2] lib: Provide generic atomic64_t implementation Paul Mackerras
2009-06-13 20:13 ` Linus Torvalds
2009-06-13 20:25 ` Linus Torvalds
2009-06-13 20:56 ` Ingo Molnar [this message]
2009-06-14 11:53 ` Avi Kivity
2009-06-14 12:21 ` Paul Mackerras
2009-06-14 13:04 ` Avi Kivity
2009-06-15 2:44 ` Roland Dreier
2009-06-15 4:30 ` Paul Mackerras
2009-06-16 22:27 ` Gabriel Paubert
2009-06-13 21:53 ` Arnd Bergmann
2009-06-18 23:55 ` Mike Frysinger
2009-06-19 0:46 ` Benjamin Herrenschmidt
2009-06-19 0:47 ` Paul Mackerras
2009-06-19 0:49 ` Mike Frysinger
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=20090613205611.GA21498@elte.hu \
--to=mingo@elte.hu \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=paulus@samba.org \
--cc=torvalds@linux-foundation.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).