Page MenuHomeFreeBSD

Dynamically select LSE-based atomic(9)s.
ClosedPublic

Authored by markj on Jan 22 2020, 8:05 PM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 23 2023, 9:20 AM
Unknown Object (File)
Nov 13 2023, 1:02 AM
Unknown Object (File)
Nov 12 2023, 3:19 AM
Unknown Object (File)
Nov 11 2023, 1:04 AM
Unknown Object (File)
Nov 9 2023, 11:44 AM
Unknown Object (File)
Nov 6 2023, 8:10 PM
Unknown Object (File)
Oct 11 2023, 2:33 AM
Unknown Object (File)
Oct 8 2023, 10:40 AM

Details

Summary

Once all CPUs are online, determine if they all support LSE atomics and
set lse_supported to indicate this.

An alternative implementation uses ifuncs to select the correct
implementation, but ifunc resolution happens before we bring up the APs,
and there exist big.little systems where some CPUs support LSE and the
rest do not(!). I think the ifunc approach is a little nicer and it
possibly gives slightly better performance, but in the absence of some
mechanism to defer ifunc resolution it is easier to go with dynamic
selection for now.

Some performance results are here:
https://people.freebsd.org/~markj/arm64_atomic/bench/

Each directory contains results from a trial of 20 -j64 buildkernels on
an EC2 graviton instance. Four kernels are used: unmodified head
(dev-base), lse-dynsel (this patch), lse-ifunc (ifunc-based atomic(9)),
and lse-uncond (unconditional use of LSE implementations).
ministat.real.txt and ministat.sys.txt contain comparisons of real and
system CPU time, respectively.

All three modified kernels give a good improvement over head, and the
overhead of dynamic selection/ifuncs is relatively small.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

Add a compile-time option which allows selection of LSE.

Are you sure that you generated diff against stock HEAD ?

In D23325#514711, @kib wrote:

Are you sure that you generated diff against stock HEAD ?

There are some intermediate revisions. I meant to add you to them, sorry. They are just mechanical.

This revision is now accepted and ready to land.Feb 2 2020, 10:12 PM
sys/arm64/conf/GENERIC
97 ↗(On Diff #67561)

Won't this break ARMv8.0 machines?

markj marked an inline comment as done.

Remove unintended update to GENERIC, left over from testing.

This revision now requires review to proceed.Feb 3 2020, 2:14 PM
This revision is now accepted and ready to land.Feb 3 2020, 2:19 PM
This revision was automatically updated to reflect the committed changes.