[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHk-=wihNu+_bGwD8F107ds7Lv1Z6ODTwvYYvXeW3im1=4R65w@mail.gmail.com>
Date: Mon, 1 Jul 2024 18:13:57 -0700
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: "Maciej W. Rozycki" <macro@...am.me.uk>
Cc: Arnd Bergmann <arnd@...db.de>, "Paul E. McKenney" <paulmck@...nel.org>,
John Paul Adrian Glaubitz <glaubitz@...sik.fu-berlin.de>, Arnd Bergmann <arnd@...nel.org>,
linux-alpha@...r.kernel.org, Richard Henderson <richard.henderson@...aro.org>,
Ivan Kokshaysky <ink@...assic.park.msu.ru>, Matt Turner <mattst88@...il.com>,
Alexander Viro <viro@...iv.linux.org.uk>, Marc Zyngier <maz@...nel.org>, linux-kernel@...r.kernel.org,
Michael Cree <mcree@...on.net.nz>, Frank Scheiner <frank.scheiner@....de>
Subject: Re: [PATCH 00/14] alpha: cleanups for 6.10
On Mon, 1 Jul 2024 at 16:48, Maciej W. Rozycki <macro@...am.me.uk> wrote:
>
> Looking from today's perspective it was clearly a bad choice. However it
> was 30+ years ago, it wasn't so certain as it is now that x86 was there to
> stay
No.
The thing is, it was objectively the wrong thing to do even 30 years
ago, and has nothing to do with x86.
The lack of byte operations literally means that even _word_
operations aren't reliable.
Because when you emulate byte operations with quad-word operations -
which is the way the alpha instruction set was literally designed -
you mess with the adjacent word too.
So even word accesses aren't safe. And I'm pretty sure that
'sig_atomic_t' was just 32-bit on alpha (that's what glibc had, and
I'm pretty sure OSF/1 did too). So...
And that's an issue even just UP, and just completely bog-standard
POSIX 1003.1 and C.
You really can't get much more basic than that.
So supposedly portable programs would have subtle bugs because the
architecture was bad, and the workarounds for that badness were
incomplete.
SMP and IO - which are a thing, and which were things that the
architecture was allegedly designed for - are then only much worse.
The architecture was wrong 30 years ago. It's not that it "became"
wrong in hindsight. It was wrong originally, and it's just that people
hadn't thought things through enough to realize how wrong it was.
The only way it's not wrong is if you say "byte accesses do not
matter". That's a very Cray way of looking at things - Cray 1 had a
64-bit "char" in C, because there were no byte accesses.
That's fine if your only goal in life is to do HPC.
So if you simply don't care about bytes, and you *only* work with
words and quad-words, then alpha looks ok.
But honestly, that's basically saying "in a different universe, alpha
is not a mis-design".
That's not the universe we live in, and it's entirely unrelated to
x86. Bytes were very much a thing 30 years ago, and they will be a
thing 30 years from now even if x86 is dead and buried.
Basically, the fundamental mistake of thinking that you can do byte
operations by just masking quad-words screwed up POSIX compatibility,
screwed up SMP, and majorly screwed up the alpha IO layer too.
And by the time it was fixed, it was too late.
Don't make excuses for it. It's not ok today, but it really wasn't ok
30 years ago either.
It's ok to have rose-colored glasses and have a weak spot in your
heart for an architecture. But let's not make that weak spot in your
heart be a weak spot in your mind.
Linus
Powered by blists - more mailing lists