public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jan Hubicka <hubicka@ucw.cz>
To: Rong Xu <xur@google.com>
Cc: Andrew Pinski <pinskia@gmail.com>,
	GCC Patches <gcc-patches@gcc.gnu.org>,
	David Li <davidxl@google.com>,
	reply@codereview.appspotmail.com
Subject: Re: [google 4.7] atomic update of profile counters (issue6965050)
Date: Thu, 20 Dec 2012 16:21:00 -0000	[thread overview]
Message-ID: <20121220162054.GA26643@atrey.karlin.mff.cuni.cz> (raw)
In-Reply-To: <CAF1bQ=T1K0iOez_=DJQD=Vnh5NDDToH_6hcn9ODLUptoz6eioA@mail.gmail.com>

> On Wed, Dec 19, 2012 at 4:29 PM, Andrew Pinski <pinskia@gmail.com> wrote:
> >
> > On Wed, Dec 19, 2012 at 12:08 PM, Rong Xu <xur@google.com> wrote:
> > > Hi,
> > >
> > > This patch adds the supprot of atomic update the profile counters.
> > > Tested with google internal benchmarks and fdo kernel build.
> >
> > I think you should use the __atomic_ functions instead of __sync_
> > functions as they allow better performance for simple counters as you
> > can use __ATOMIC_RELAXED.
> 
> You are right. I think __ATOMIC_RELAXED should be OK here.
> Thanks for the suggestion.
> 
> >
> > And this would be useful for the trunk also.  I was going to implement
> > this exact thing this week but some other important stuff came up.
> 
> I'll post trunk patch later.

Yes, I like that patch, too. Even if the costs are quite high (and this is why
atomic updates was sort of voted down in the past) the alternative of using TLS
has problems with too-much per-thread memory.

While there are even more alternatives, like recording the changes and
commmiting them in blocks (say at function return), I guess some solution is
better than no solution.

Thanks,
Honza

  reply	other threads:[~2012-12-20 16:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-19 20:08 Rong Xu
2012-12-20  0:25 ` Xinliang David Li
2012-12-20  0:29 ` Andrew Pinski
2012-12-20  0:56   ` Rong Xu
2012-12-20 16:21     ` Jan Hubicka [this message]
2012-12-20 16:57       ` Andrew Pinski
2012-12-20 19:35         ` Rong Xu
2012-12-20 19:42           ` Andrew Pinski
2012-12-21  9:13         ` Jan Hubicka
2012-12-21  9:55           ` Richard Biener
2012-12-21 10:36             ` Jan Hubicka

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=20121220162054.GA26643@atrey.karlin.mff.cuni.cz \
    --to=hubicka@ucw.cz \
    --cc=davidxl@google.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=pinskia@gmail.com \
    --cc=reply@codereview.appspotmail.com \
    --cc=xur@google.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 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 read-only IMAP folder(s) and NNTP newsgroup(s).