From 653ef302d23425efa71be19f13e6867bc9bd7e1a Mon Sep 17 00:00:00 2001 From: Carlos O'Donell Date: Tue, 15 Aug 2023 12:07:04 -0400 Subject: [PATCH] Fix string and memory function tuning on small systems (#2180462) Related: #2180462 --- glibc-rh2180462-4.patch | 39 +++++++++++++++++++++++++++++++++++++++ glibc.spec | 6 +++++- 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 glibc-rh2180462-4.patch diff --git a/glibc-rh2180462-4.patch b/glibc-rh2180462-4.patch new file mode 100644 index 0000000..e0c568a --- /dev/null +++ b/glibc-rh2180462-4.patch @@ -0,0 +1,39 @@ +Adjusted for backport to c8s by modifying sysdeps/x86/cacheinfo.h. + +commit 885a7f0feee951f514a121788f46f33b2867110f +Author: Noah Goldstein +Date: Fri Aug 11 12:29:11 2023 -0500 + + x86: Fix incorrect scope of setting `shared_per_thread` [BZ# 30745] + + The: + + ``` + if (shared_per_thread > 0 && threads > 0) + shared_per_thread /= threads; + ``` + + Code was accidentally moved to inside the else scope. This doesn't + match how it was previously (before af992e7abd). + + This patch fixes that by putting the division after the `else` block. + +diff --git a/sysdeps/x86/cacheinfo.h b/sysdeps/x86/cacheinfo.h +index 4dbfa979ef052eaa..e53fa25106c95253 100644 +--- a/sysdeps/x86/cacheinfo.h ++++ b/sysdeps/x86/cacheinfo.h +@@ -243,11 +243,10 @@ get_common_cache_info (long int *shared_ptr, long int * shared_per_thread_ptr, u + level. */ + threads = ((cpu_features->features[COMMON_CPUID_INDEX_1].cpuid.ebx >> 16) + & 0xff); +- +- /* Get per-thread size of highest level cache. */ +- if (shared_per_thread > 0 && threads > 0) +- shared_per_thread /= threads; + } ++ /* Get per-thread size of highest level cache. */ ++ if (shared_per_thread > 0 && threads > 0) ++ shared_per_thread /= threads; + } + + /* Account for non-inclusive L2 and L3 caches. */ diff --git a/glibc.spec b/glibc.spec index 1b151be..2269998 100644 --- a/glibc.spec +++ b/glibc.spec @@ -1,6 +1,6 @@ %define glibcsrcdir glibc-2.28 %define glibcversion 2.28 -%define glibcrelease 235%{?dist} +%define glibcrelease 236%{?dist} # Pre-release tarballs are pulled in from git using a command that is # effectively: # @@ -1046,6 +1046,7 @@ Patch853: glibc-rh2176707-3.patch Patch854: glibc-rh2180462-1.patch Patch855: glibc-rh2180462-2.patch Patch856: glibc-rh2180462-3.patch +Patch857: glibc-rh2180462-4.patch ############################################################################## # Continued list of core "glibc" package information: @@ -2876,6 +2877,9 @@ fi %files -f compat-libpthread-nonshared.filelist -n compat-libpthread-nonshared %changelog +* Tue Aug 15 2023 Carlos O'Donell - 2.28-236 +- Fix string and memory function tuning on small systems (#2180462) + * Tue Aug 8 2023 DJ Delorie - 2.28-235 - Fix temporal threshold calculations (#2180462)