Re: [PATCH] "volatile considered harmful", take 2

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

 



Johannes Stezenbach wrote:
> On Fri, May 11, 2007 at 02:08:54AM +0530, jimmy bahuleyan wrote:
>> Jonathan Corbet wrote:
>> [snip..]
>>> +
>>> +  - The jiffies variable is special in that it can have a different value
>>> +    every time it is referenced, but it can be read without any special
>>> +    locking.  So jiffies can be volatile, but the addition of other
>>> +    variables of this type is strongly frowned upon.  Jiffies is considered
>>> +    to be a "stupid legacy" issue in this regard.
>> Why is it that you consider jiffies to be a "stupid legacy"? Isn't it
>> natural to have a externally modified variable which is only /read/ to
>> be volatile? (or is jiffies supposed to be replaced with something
>> smarter/better :)
> 
> "stupid legacy" were Linus' words. http://lwn.net/Articles/233482/
> 
> How about this:
> 
> "The jiffies variable is a special case because there are too
> many places in the kernel which would have to be changed and reviewed
> if the volatile would be removed from jiffies. However, the
> use of volatile qualifier for jiffies is just as wrong as
> it is elsewhere. Don't use jiffies as an excuse to use volatile
> in your code."
> 
> 
> Johannes
> 

yes this sounds better. at least to a non-kernel expert like me it makes
the meaning clear - 'that jiffies is a special case, not to be taken as
an example for other stuff'.

-jb

-- 
Tact is the art of making a point without making an enemy.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux