lscpu cache information is incorrect with focal on arm 64-bit platform (ThunderX2)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
util-linux (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
Platform: Cavium Sabre Marvell ThunderX2
The L1/L2/L3 cache output by "lscpu" is incorrect, and differes from the output with bionic.
[Steps to Reproduce]
1. Install ubuntu server (focal) on Sabre
2. lspci
[Expected Result]
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 32768K
[Actual Result]
L1d cache: 1.8 MiB
L1i cache: 1.8 MiB
L2 cache: 14 MiB
L3 cache: 64 MiB
[More Information]
1. eoan could reproduce this issue.
2. bionic-hwe could not reproduce this issue (5.3.0-46-generic #38~18.04.1-Ubuntu)
3. with focal, check the cpu cache directly from the virtual devices and the cache information looks good:
$ cat /sys/devices/
1
32K
4. More information about the system which could reproduce the issue:
ubuntu@
1
32K
ubuntu@
Linux apollo 5.4.0-24-generic #28-Ubuntu SMP Thu Apr 9 22:17:51 UTC 2020 aarch64 aarch64 aarch64 GNU/Linux
ubuntu@
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu Focal Fossa (development branch)
Release: 20.04
Codename: focal
ubuntu@
Desired=
| Status=
|/ Err?=(none)
||/ Name Version Architecture Description
+++
ii util-linux 2.34-0.1ubuntu9 arm64 miscellaneous system utilities
ubuntu@
ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: util-linux 2.34-0.1ubuntu9
ProcVersionSign
Uname: Linux 5.4.0-24-generic aarch64
ApportVersion: 2.20.11-0ubuntu26
Architecture: arm64
CasperMD5CheckR
Date: Fri Apr 17 16:00:13 2020
SourcePackage: util-linux
UpgradeStatus: No upgrade log present (probably fresh install)
Hi Taihsiang,
Thanks for reporting this bug.
This is an upstream deliberate change in output format of caches in lscpu.
They introduced the '--caches' option to provide individual/total sizes.
It affects other architectures as well, not just arm64; e.g., amd64.
For example, on my laptop:
Bionic:
$ lscpu | grep cache
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 3072K
Focal:
$ lscpu | grep cache
L1d cache: 64 KiB
L1i cache: 64 KiB
L2 cache: 512 KiB
L3 cache: 3 MiB
On Eoan and later you can use `lscpu --caches` to get all/individual cache information.
Focal:
$ lscpu --caches
NAME ONE-SIZE ALL-SIZE WAYS TYPE LEVEL
L1d 32K 64K 8 Data 1
L1i 32K 64K 8 Instruction 1
L2 256K 512K 4 Unified 2
L3 3M 3M 12 Unified 3
$ lscpu --caches=one-size
ONE-SIZE
32K
32K
256K
3M
For documentation purposes, this is the PR requesting/ discussing it [1], and this is the patch changing it [2].
Since this has been an upstream decision (see PR comments and patch), I guess it's unlikely they'd change it back (even though it broke the previous output convention, as that has been mentioned/ acknowledged in the PR.)
This patch has been introduced on 2.34, so Eoan and later have this format change.
Hope this helps,
Mauricio
[1] https:/ /github. com/karelzak/ util-linux/ issues/ 663 /github. com/karelzak/ util-linux/ commit/ e5f721132ec8b8c 933a396d8dcb3ef cb67854f13
[2] https:/