On Mon, 6 Jan 2025 at 16:59, Linus Torvalds
<torva...@linux-foundation.org> wrote:
>
> There is absolutely no gray area here. It was always buggy, and the
> alpha architecture was always completely and fundamentally
> mis-designed.

Note that I really do want to re-emphasize that while I think it's
kind of interesting that Maciej is trying to make gcc DTRT on alpha,
the non-BWX machines really are a completely broken architecture and
almost entirely unfixable.

Yeah, yeah, Maciej also has patches to avoid all the ldq_u/stq_u
sequences for regular byte accesses into actually using ldl_l / stl_c
sequences, but those instructions take hundreds of cycles and go out
on the bus outside the CPU.

So using actual thread-safe byte ops with ldl_l / stl_c turns those
non-BWX alpha CPU's into something very sad and pointless. You might
as well go full retro and use a 6502 or something.

And even the newer alphas that *had* BWX were designed to still do
byte operations with quadword ops and masking. Yes, byte ops existed,
but they were still very much designed as a "only when you really
can't use the masked word model".

For example, the standard "memset()" library routine for EV6 literally
does exactly the thing that I said would be a compiler bug to do.

Because that's literally the core design of the architecture: it's buggy.

So while I applaud Maciej's efforts, I'm not convinced they are all
that productive. Even with a fixed compiler, it's all broken anyway.

Of course, most of the time, you won't ever see the breakage. It's
there, but hitting it in practice is almost impossible.

The Linux kernel uses the known-broken memcpy and memset library code.
All user space does the same.

They are hopelessly and fundamentally broken, but they work in
practice as long as you don't have concurrent accesses "near-by" in
space-time.

                 Linus

Reply via email to