linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Mike Frysinger <vapier.adi@gmail.com>
To: Paul Mackerras <paulus@samba.org>
Cc: akpm@linux-foundation.org, torvalds@linux-foundation.org,
	linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org
Subject: Re: [PATCH 1/2] lib: Provide generic atomic64_t implementation
Date: Thu, 18 Jun 2009 20:49:02 -0400	[thread overview]
Message-ID: <8bd0f97a0906181749h43f70338te96ea41f90caa3b7@mail.gmail.com> (raw)
In-Reply-To: <19002.57382.880505.913539@cargo.ozlabs.ibm.com>

On Thu, Jun 18, 2009 at 20:47, Paul Mackerras wrote:
> Mike Frysinger writes:
>> On Sat, Jun 13, 2009 at 03:10, Paul Mackerras wrote:
>> > +typedef struct {
>> > + =C2=A0 =C2=A0 =C2=A0 long long counter;
>> > +} atomic64_t;
>>
>> lack of volatile seems odd compared to:
>> include/linux/types.h:
>> typedef struct {
>> =C2=A0 =C2=A0 volatile int counter;
>> } atomic_t;
>
> It's only accessed under a spinlock, so I don't think it needs to be
> volatile. =C2=A0On UP it's accessed within local_irq_save/restore which
> should also be compiler barriers and prevent memory access reordering,
> so again volatile isn't needed.

i'm not suggesting it is needed, i'm saying it's a bit confusing.  a
simple comment above the atomic64_t type with your simple explanation
here would go a long way.
-mike

      reply	other threads:[~2009-06-19  0:49 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
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 [this message]

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=8bd0f97a0906181749h43f70338te96ea41f90caa3b7@mail.gmail.com \
    --to=vapier.adi@gmail.com \
    --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).