Re: __atomic_test_and_set() and mips o32 - help wanted

Jason Thorpe <[email protected]> Wed, 19 Nov 2025 13:25:44 +0100
Newsgroups gmane.os.netbsd.ports.alpha,gmane.os.netbsd.ports.mips.devel,gmane.os.netbsd.devel.toolchain
Message-ID <[email protected]>
> On Nov 19, 2025, at 1:17=E2=80=AFPM, Jason Thorpe <[email protected]> =
wrote:
>=20
> The traps themselves are cheap, but that does not always equate to =
=E2=80=9Ctrap handling is cheap=E2=80=9D.
>=20
> I agree with you vis a vis "making appropriate trade-offs is good, =
actually=E2=80=9D, but I=E2=80=99d also like to point out that work =
described in the original paper on restartable atomic sequences was done =
on an R3000 (DECstation 5000/200).

It=E2=80=99s also worth remembering that emulating ll/sc requires =
**two** traps per =E2=80=9Catomic test-and-set=E2=80=9D.  Unless, of =
course, you=E2=80=99re going to increase the complexity of the trap =
handler to work forward from the ll and interpret the instructions up to =
the sc.

-- thorpej