]> git.ipfire.org Git - thirdparty/glibc.git/commit
x86: Fix slight bug in `shared_per_thread` cache size calculation.
authorNoah Goldstein <goldstein.w.n@gmail.com>
Tue, 18 Jul 2023 04:14:33 +0000 (23:14 -0500)
committerNoah Goldstein <goldstein.w.n@gmail.com>
Tue, 12 Sep 2023 03:47:08 +0000 (22:47 -0500)
commit31b06441f9f82be270b3fe486eaa76bd1d866477
tree83bc5eb291eda642fa4c00c1da5d7cbb19939142
parent5e2d2d7cbd32a148b660d40496e477271b2805d2
x86: Fix slight bug in `shared_per_thread` cache size calculation.

After:
```
    commit af992e7abdc9049714da76cae1e5e18bc4838fb8
    Author: Noah Goldstein <goldstein.w.n@gmail.com>
    Date:   Wed Jun 7 13:18:01 2023 -0500

        x86: Increase `non_temporal_threshold` to roughly `sizeof_L3 / 4`
```

Split `shared` (cumulative cache size) from `shared_per_thread` (cache
size per socket), the `shared_per_thread` *can* be slightly off from
the previous calculation.

Previously we added `core` even if `threads_l2` was invalid, and only
used `threads_l2` to divide `core` if it was present. The changed
version only included `core` if `threads_l2` was valid.

This change restores the old behavior if `threads_l2` is invalid by
adding the entire value of `core`.
Reviewed-by: DJ Delorie <dj@redhat.com>
(cherry picked from commit 47f747217811db35854ea06741be3685e8bbd44d)
sysdeps/x86/dl-cacheinfo.h