mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: Jamie Lokier <jamie@shareable.org>
Cc: Anton Blanchard <anton@samba.org>,
	akpm@linux-foundation.org, willy@linux.intel.com,
	benh@kernel.crashing.org, paulus@samba.org,
	linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2]: atomic_t: Remove volatile from atomic_t definition
Date: Mon, 17 May 2010 13:20:51 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LFD.2.00.1005171314590.4195@i5.linux-foundation.org> (raw)
In-Reply-To: <20100517201339.GJ20356@shareable.org>



On Mon, 17 May 2010, Jamie Lokier wrote:
> 
> I wonder if
> 
>    extern unsigned long __nv_jiffies;
>    #define jiffies (*(volatile unsigned long *)*__nv_jiffies)
> 
> would improve any code in the same way as this atomic_t change.

We effectively already do that. The full 64-bit jiffies isn't volatile. 
But for legacy reasons, we have that "word-sized subpart" of the full 
counter that is volatile - and we're using linker tricks rather the the C 
preprocessor to do the above thing.

So no, there's no room for improvement for jiffies - the only people who 
ever use the volatile jiffies are things that read it. There are no 
initializers that matter, and the updates (which also tend to suck with 
"volatile" because gcc just doesn't do even the obvious optimizations) are 
all done locked and to the non-volatile jiffies_64.

		Linus

  reply	other threads:[~2010-05-17 20:23 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-17  4:33 [PATCH 1/2]: atomic_t: Cast to volatile when accessing atomic variables Anton Blanchard
2010-05-17  4:34 ` [PATCH 2/2]: atomic_t: Remove volatile from atomic_t definition Anton Blanchard
2010-05-17  8:58   ` Heiko Carstens
2010-05-17 15:01   ` Linus Torvalds
2010-05-17 20:13     ` Jamie Lokier
2010-05-17 20:20       ` Linus Torvalds [this message]
2010-05-19 13:03     ` Nick Piggin
2010-05-19 14:55       ` Linus Torvalds
2010-05-19 15:01       ` Paul E. McKenney
2010-05-19 19:54         ` David Miller
2010-05-19 22:50           ` Paul E. McKenney
2010-05-21  5:27             ` Nick Piggin
2010-05-21  5:54               ` David Miller
2010-05-21  6:06                 ` Nick Piggin
2010-05-21  6:10                   ` David Miller
2010-05-21  6:44                     ` Eric Dumazet

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=alpine.LFD.2.00.1005171314590.4195@i5.linux-foundation.org \
    --to=torvalds@linux-foundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=anton@samba.org \
    --cc=benh@kernel.crashing.org \
    --cc=jamie@shareable.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulus@samba.org \
    --cc=willy@linux.intel.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

all inboxes | Powered by JetHome®