mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Johannes Stezenbach <js@linuxtv.org>
To: jimmy bahuleyan <knight.camelot@gmail.com>
Cc: Jonathan Corbet <corbet@lwn.net>,
	linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
	Jesper Juhl <jesper.juhl@gmail.com>,
	Randy Dunlap <randy.dunlap@oracle.com>,
	Heikki Orsila <shdl@zakalwe.fi>, "H. Peter Anvin" <hpa@zytor.com>,
	Satyam Sharma <satyam.sharma@gmail.com>
Subject: Re: [PATCH] "volatile considered harmful", take 2
Date: Fri, 11 May 2007 14:21:13 +0200	[thread overview]
Message-ID: <20070511122113.GB15972@linuxtv.org> (raw)
In-Reply-To: <464382DE.5020206@gmail.com>

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

  parent reply	other threads:[~2007-05-11 12:21 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-10 20:20 Jonathan Corbet
2007-05-10 20:38 ` jimmy bahuleyan
2007-05-10 21:44   ` Satyam Sharma
2007-05-11 12:21   ` Johannes Stezenbach [this message]
2007-05-11 13:52     ` jimmy bahuleyan
2007-05-11 14:21     ` Satyam Sharma
2007-05-10 21:34 ` Jan Engelhardt
2007-05-10 21:45   ` H. Peter Anvin
2007-05-11 21:33     ` Jan Engelhardt
2007-05-11 21:47       ` H. Peter Anvin
     [not found]         ` <64026d4a0705112157p75d76956g40455c7402b096d6@mail.gmail.com>
2007-05-12  5:32           ` H. Peter Anvin
2007-05-11  7:41 ` Philipp Matthias Hahn
2007-05-11  8:41 ` Bernd Eckenfels
2007-05-11 11:17 ` Stefan Richter

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=20070511122113.GB15972@linuxtv.org \
    --to=js@linuxtv.org \
    --cc=akpm@linux-foundation.org \
    --cc=corbet@lwn.net \
    --cc=hpa@zytor.com \
    --cc=jesper.juhl@gmail.com \
    --cc=knight.camelot@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=randy.dunlap@oracle.com \
    --cc=satyam.sharma@gmail.com \
    --cc=shdl@zakalwe.fi \
    /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

Powered by JetHome