All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@steeleye.com>
To: Linus Torvalds <torvalds@osdl.org>
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: 26 Jun 2004 12:18:16 -0500	[thread overview]
Message-ID: <1088270298.1942.40.camel@mulgrave> (raw)
In-Reply-To: <Pine.LNX.4.58.0406260948070.14449@ppc970.osdl.org>

On Sat, 2004-06-26 at 11:54, Linus Torvalds wrote:
> On Sat, 26 Jun 2004, James Bottomley wrote:
> >
> > On Sat, 2004-06-26 at 11:32, Linus Torvalds wrote:
> > > 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));

I tried this on PA.  Our gcc definitely generates the correct code, even
without the volatile...

By the way, I had to try with a genuine volatile since
tasklet_struct.state isn't actually volatile in linux/interrupt.h

> > > and the thing is supposed to work.
> > 
> > Well, I agree it's supposed to work, what I don't agree about is that
> > generic code gets to designate critical data as volatile.
> 
> I agree in the sense that I don't think the _data_ should be volatile.
> 
> But I think the functions to access various pieces of data should be able 
> to take volatiles without warning.
> 
> See the difference? Same way "memcpy()" takes a "const" argument for the 
> source. That doesn't mean that the source _has_ to be const, it just means 
> that it won't complain if it is.
> 
> And the same is true of "volatile" for the bitop functions. They are 
> volatile not because they require the data to be volatile, but because 
> they have at least traditionally been used for various cases, _including_ 
> volatile.

But in the current kernel, there are no bitops on volatile data in the
parisc tree.  This cpumask is the first such one that we've come
across...

> Now, we could say that we don't do that any more, and decide that the 
> regular bitop functions really cannot be used on volatile stuff. But 
> that's a BIG decision. And it's certainly not a decision that parisc 
> users should make.

But that's my point.  Currently there is no volatile pointer bitops (and
I have bitten the heads off a few people who tried to introduce some),
so there's no existing case to justify being backward compatible with.

> Well, at least judging by your "test_bit()", the function literally is 
> _not_ coded to work with volatile data.

test_bit's a special case.  The lock is to prevent data corruption, not
racing between test_bit and set_bit.

> If the above loop had been a real case, gcc on parisc would have optimized 
> it away, and done the wrong thing.

That's not what our gcc seems to do (both 3.0.4 and 3.3.4)

James



  reply	other threads:[~2004-06-26 17:18 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-26 16:08 [PATCH] Fix the cpumask rewrite James Bottomley
2004-06-26 16:32 ` Linus Torvalds
2004-06-26 16:32 ` Linus Torvalds
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 [this message]
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
2004-06-27 17:39         ` [parisc-linux] " Linus Torvalds
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=1088270298.1942.40.camel@mulgrave \
    --to=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 \
    --cc=torvalds@osdl.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.