Re: [PATCH 2/2]: atomic_t: Remove volatile from atomic_t definition

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




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
--
To unsubscribe from this list: send the line "unsubscribe linux-arch" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux