Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 16 Apr 2018 16:10:12 +0000
From:      Brooks Davis <brooks@freebsd.org>
To:        freebsd-arch@freebsd.org
Subject:   Do fuswintr/suswintr make sense?
Message-ID:  <20180416161012.GB44509@spindle.one-eyed-alien.net>

next in thread | raw e-mail | index | archive | help

--NMuMz9nt05w80d4+
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

The fuswintr() and suswintr() are intended to be safe in interrupt
context.  They are used in the profiling code and if they fail the code
falls back to triggering a trap with appropriate fields in struct
thread.  This is fine as such, but amd64, arm, i386, and powerpc have
implementations that always fail.  arm64, mips, riscv, and sparc64 all
add code to the trap handler to detect that this particular code has
faulted and return to the handler before doing and processing that might
result in a sleep.  This optimization came from 4.4BSD.

Does this optimization actually make sense in 2017, particularly
given that we're not taking advantage of it on x86 (and worse, our
implementations of return (-1) aren't inlined so they have cache
impacts)?

-- Brooks

--NMuMz9nt05w80d4+
Content-Type: application/pgp-signature; name="signature.asc"

-----BEGIN PGP SIGNATURE-----

iQEcBAEBAgAGBQJa1MrjAAoJEKzQXbSebgfAHLAH/jFFiIiAB9NH0wQiLu8d1nLT
++fy2Ul9Gh4nqiDInBdyh8BpRpSd1ZipKhDgxo3NV+cGy6CH7OvTd+Y8G2py5N9v
3soc9GF+I1p9K/ByVEHco3bTbTOzhO5WEMHnjgCWyjFC7ZS46+taWGp4pqUMjvUO
3AWHNWJy/0hLcX9ecWSV91GRk1Um3CqZPB+G2fdF+ppitsYcRrNsnH98mUMFbttc
xwnp+KPIxatNxcadZOc7elhaA5Asdoo+IbPK5erOefzKlukKlz60JJ/KWt5wv79+
qktA0x4EvwKRghYels7ffQcpDSWFPmCudfBC3DYpX/OqsEjMmZzJra3TQkHrXnY=
=tbmI
-----END PGP SIGNATURE-----

--NMuMz9nt05w80d4+--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20180416161012.GB44509>