News: 0001470103

  ARM Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life (Terry Pratchett, Jingo)

Intel's Glibc Non-Temporal Stores Memset Optimization Extended To AMD CPUs

([GNU] 63 Minutes Ago Faster Memset)


Merged last month to the GNU C Library (glibc) Git code was a new tunable for non-temporal stores for memset. This optimization for glibc's memset performance was limited to Intel processors given at the time it was only tested/benchmarked on Intel CPUs but now it's proven to be useful too for AMD processors.

Intel toolchain engineer Noah Goldstein last month introduced this "glibc.cpu.x86_memset_non_temporal_threshold" tunable for setting the threshold for non-temporal store in memset. The x86_memset_non_temporal_threshold documentation explains:

"The glibc.cpu.x86_memset_non_temporal_threshold tunable allows the user to set threshold in bytes for non temporal store in memset. Non temporal stores give a hint to the hardware to move data directly to memory without displacing other data from the cache. This tunable is used by some platforms to determine when to use non temporal stores memset."

This memset non-temporal tunable was artificially limited to just on Intel processors given that is where it was tested and found to be of performance benefit. After all, it was an Intel engineer leading the change.

Merged on Monday to Glibc Git though is now extending this tunable for AMD processors. Fastly's Joe Damato did the testing and found that this is beneficial for AMD processors. Benchmarks have shown the non-temporal memset is beneficial for AMD processors in tests carried out across Zen 2, Zen 3, and Zen 4 hardware. The data for those interested can be found via [1]this Google Docs spreadsheet for the various AMD Zen CPUs as well as the Intel numbers.

[2]This commit now in Glibc allows for this tunable to work on AMD platforms.



[1] https://docs.google.com/spreadsheets/d/1opzukzvum4n6-RUVHTGddV6RjAEil4P2uMjjQGLbLcU/edit#gid=0

[2] https://sourceware.org/git/?p=glibc.git;a=commit;h=bef2a827a55fc759693ccc5b0f614353b8ad712d



pegasus

Oxygen is a very toxic gas and an extreme fire hazard. It is fatal in
concentrations of as little as 0.000001 p.p.m. Humans exposed to the
oxygen concentrations die within a few minutes. Symptoms resemble very
much those of cyanide poisoning (blue face, etc.). In higher
concentrations, e.g. 20%, the toxic effect is somewhat delayed and it
takes about 2.5 billion inhalations before death takes place. The reason
for the delay is the difference in the mechanism of the toxic effect of
oxygen in 20% concentration. It apparently contributes to a complex
process called aging, of which very little is known, except that it is
always fatal.

However, the main disadvantage of the 20% oxygen concentration is in the
fact it is habit forming. The first inhalation (occurring at birth) is
sufficient to make oxygen addiction permanent. After that, any
considerable decrease in the daily oxygen doses results in death with
symptoms resembling those of cyanide poisoning.

Oxygen is an extreme fire hazard. All of the fires that were reported in
the continental U.S. for the period of the past 25 years were found to be
due to the presence of this gas in the atmosphere surrounding the buildings
in question.

Oxygen is especially dangerous because it is odorless, colorless and
tasteless, so that its presence can not be readily detected until it is
too late.
-- Chemical & Engineering News February 6, 1956