linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@transmeta.com>
To: Andrea Arcangeli <andrea@suse.de>
Cc: Richard Gooch <rgooch@ras.ucalgary.ca>,
	Chris Friesen <cfriesen@nortelnetworks.com>,
	Jeff Dike <jdike@karaya.com>,
	user-mode-linux-user <user-mode-linux-user@lists.sourceforge.net>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Jan Hubicka <jh@suse.cz>
Subject: Re: user-mode port 0.44-2.4.7
Date: Tue, 24 Jul 2001 09:04:28 -0700 (PDT)	[thread overview]
Message-ID: <Pine.LNX.4.33.0107240849240.29354-100000@penguin.transmeta.com> (raw)
In-Reply-To: <20010724020413.A29561@athlon.random>


On Tue, 24 Jul 2001, Andrea Arcangeli wrote:
> On Mon, Jul 23, 2001 at 05:47:04PM -0600, Richard Gooch wrote:
> > I don't think it should be allowed to do that. That's a whipping
>
> it is allowed to do that, period. This is not your choice or my choice.
> You may ask gcc folks not to do that and I think they just do.

Stop this stupid argument.

A C compiler is "allowed" to do just about anything. The introduction of
"volatile" does not change that in any really meaningful way. It doesn't
change the fact that gcc is "allowed" to do a really shitty job on _any_
code it is given.

>From a pure standards standpoint, gcc can change something like

	int i = *int_ptr;

into the equivalent of (assuming a little-endian machine with only byte
load/store instructions)

	unsigned char *tmp = (unsigned char *)int_ptr + 3;
	int j = 4;
	int i = 0;

	do {
		i <<= 8;
		i += *tmp;
		tmp--;
	} while (--j);

The fact that a C compiler is _allowed_ to create code like just about
anything is not an argument at all.

The above, btw, is NOT as ridiculous as it sounds. We've had the exact
opposite problem on alpha: byte stores are not "atomic", and would
"corrupt" the bytes around it due to the non-atomic nature of having to do

	load word
	mask value
	insert byte
	store word

Did it help to mark things "volatile" there? No. We had to change the code
to (a) either use locking so that nobody would ever touch adjacent bytes
concurrently or (b) stop using byte values.

			Linus


  parent reply	other threads:[~2001-07-24 16:06 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-23  5:08 user-mode port 0.44-2.4.7 Jeff Dike
2001-07-23 15:56 ` Andrea Arcangeli
2001-07-23 15:59   ` Andrea Arcangeli
2001-07-23 16:17     ` Andrea Arcangeli
2001-07-23 16:51       ` Andrea Arcangeli
2001-07-23 16:33   ` Linus Torvalds
2001-07-23 16:45     ` Andrea Arcangeli
2001-07-23 17:32       ` Linus Torvalds
2001-07-23 17:50         ` Andrea Arcangeli
2001-07-23 18:11           ` Linus Torvalds
2001-07-23 18:27             ` Andrea Arcangeli
2001-07-23 20:00               ` Linus Torvalds
2001-07-23 20:15                 ` Jonathan Lundell
2001-07-23 22:51                   ` Linus Torvalds
2001-07-24  3:45                     ` Jonathan Lundell
2001-07-24 15:41                       ` Davide Libenzi
2001-07-24 15:46                         ` Alexander Viro
2001-07-24 16:01                           ` Davide Libenzi
2001-07-24 16:08                             ` Alexander Viro
2001-07-24 16:52                               ` Davide Libenzi
2001-07-24 16:59                                 ` Linus Torvalds
2001-07-24 17:31                                   ` Davide Libenzi
2001-07-24 17:38                                     ` Linus Torvalds
2001-07-24 18:07                               ` Anton Altaparmakov
2001-07-23 20:44                 ` Chris Friesen
2001-07-23 21:11                   ` Andrea Arcangeli
2001-07-23 21:50                   ` Richard Gooch
2001-07-23 22:09                     ` Andrea Arcangeli
2001-07-23 13:20                       ` Rob Landley
2001-07-23 22:27                         ` Andrea Arcangeli
2001-07-23 17:50                           ` Rob Landley
2001-07-23 23:47                     ` Richard Gooch
2001-07-24  0:04                       ` Andrea Arcangeli
2001-07-24  9:02                         ` Jan Hubicka
2001-07-24 15:35                           ` Linus Torvalds
2001-07-24 16:04                         ` Linus Torvalds [this message]
2001-07-25 22:49                           ` Andrea Arcangeli
2001-07-25 23:16                             ` Linus Torvalds
2001-07-25 23:37                               ` Chris Friesen
2001-07-26 18:28                             ` Jan Hubicka
2001-07-26 18:35                               ` Alan Cox
2001-07-23 22:53                   ` Linus Torvalds
2001-07-23 23:13                     ` Alan Cox
2001-07-23 20:25   ` Jeff Dike
     [not found] <no.id>
2001-07-23 20:57 ` Alan Cox
2001-07-23 21:14   ` Chris Friesen
2001-07-25 19:12 ` Alan Cox
2001-07-25 23:49 ` Alan Cox
2001-07-25 19:03 James W. Lake

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.33.0107240849240.29354-100000@penguin.transmeta.com \
    --to=torvalds@transmeta.com \
    --cc=andrea@suse.de \
    --cc=cfriesen@nortelnetworks.com \
    --cc=jdike@karaya.com \
    --cc=jh@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rgooch@ras.ucalgary.ca \
    --cc=user-mode-linux-user@lists.sourceforge.net \
    /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;
as well as URLs for NNTP newsgroup(s).