mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@osdl.org>
To: James Bottomley <James.Bottomley@SteelEye.com>
Cc: Andrew Morton <akpm@osdl.org>, Paul Jackson <pj@sgi.com>,
	PARISC list <parisc-linux@lists.parisc-linux.org>,
	Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] Fix the cpumask rewrite
Date: Sat, 26 Jun 2004 09:32:15 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.58.0406260924570.14449@ppc970.osdl.org> (raw)
In-Reply-To: <1088266111.1943.15.camel@mulgrave>



On Sat, 26 Jun 2004, James Bottomley wrote:
>  
> This might be correct for x86 and itanium, but it isn't for parisc where
> our bitmap operators don't take volatile pointers.

Why not? The thing is, the bitmap operators are supposed to work on 
volatile data, ie people are literally using them for things like

	while (test_bit(TASKLET_STATE_SCHED, &t->state));

and the thing is supposed to work.

Now, I personally am not a big believer in the "volatile" keyword itself, 
since I believe that anybody who expects the compiler to generate 
different code for volatiles and non-volatiles is pretty much waiting for 
a bug to happen, but there are two cases where I think it's ok:

 - in function prototypes to show that the function can take volatile data 
   (and not complain).

 - as an arch-specific low-level implementation detail to avoid having to 
   use inline assembly just to load a value. Ie a _data_structure_ should 
   never be volatile, but it's ok to use a volatile pointer for a single 
   access.

I believe the bitop functions fall under #1 - the function is clearly
supposed to handle the case of a volatile pointer, and if it is inlined,
the above endless while-loop must not just load the bit once and turn it 
into an endless loop - it needs to re-load the thing every iteration.

> Since whether the bitmap operators are volatile or not is within the
> province of the architecture to decide,

I disagree. Why wouldn't they be volatile?

		Linus

  reply	other threads:[~2004-06-26 16:34 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-26 16:08 James Bottomley
2004-06-26 16:32 ` Linus Torvalds [this message]
2004-06-26 16:44   ` Linus Torvalds
2004-06-26 16:46   ` James Bottomley
2004-06-26 16:54     ` Linus Torvalds
2004-06-26 17:18       ` James Bottomley
2004-06-26 18:01         ` Linus Torvalds
2004-06-26 18:28           ` Vojtech Pavlik
2004-06-26 18:54             ` Linus Torvalds
2004-06-26 19:02               ` James Bottomley
2004-06-26 19:13                 ` Linus Torvalds
2004-06-26 19:13               ` Vojtech Pavlik
2004-06-26 18:59           ` James Bottomley
2004-06-26 19:11             ` Linus Torvalds
2004-06-26 19:33               ` James Bottomley
2004-06-28 23:16           ` Jonathan Lundell
2004-07-01 13:11       ` Pavel Machek
2004-07-01 14:07         ` [parisc-linux] " Alan Cox
2004-07-01 16:15           ` Linus Torvalds
2004-07-01 16:52             ` Jeff Garzik
2004-07-01 17:42               ` Linus Torvalds
2004-06-26 22:18   ` Chris Wedgwood
2004-06-26 22:48     ` Linus Torvalds
2004-06-26 22:54       ` [parisc-linux] " Alan Cox
2004-06-27  0:05         ` Chris Wedgwood
2004-06-27 12:00           ` Matthias Urlichs
2004-06-27 22:41             ` Chris Wedgwood
2004-06-28  1:24               ` Matthias Urlichs
2004-06-28  5:42                 ` Chris Wedgwood
2004-06-28  6:55                   ` Matthias Urlichs
2004-06-28  7:02                     ` Chris Wedgwood
2004-06-28  7:19                       ` Matthias Urlichs
2004-06-27 14:37           ` Alan Cox
2004-07-01 13:33             ` Pavel Machek
2004-07-01 17:43               ` Chris Wedgwood
2004-06-26 23:37       ` jiffies_64 Chris Wedgwood
2004-06-27  1:55       ` more (insane) jiffies ranting Chris Wedgwood
2004-06-27 17:39         ` Linus Torvalds

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=Pine.LNX.4.58.0406260924570.14449@ppc970.osdl.org \
    --to=torvalds@osdl.org \
    --cc=James.Bottomley@SteelEye.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=parisc-linux@lists.parisc-linux.org \
    --cc=pj@sgi.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®