[Bug 1868028] Re: L2\L3 cache display error for using "getconf -a" command"
Taihsiang Ho
taihsiang.ho at canonical.com
Wed Apr 15 06:08:14 UTC 2020
This is not a kernel issue. I would suggest "won't fix" for this issue
from technical point of view:
1) This is not a bug but a feature restriction of the tool getconf[1]. We could only retrieve the cpu cache information in another way, which is not what getconf is using now. Because the upstream does not update the retrieve method, we could not avoid to re-implement the retrieve method. Besides, 0 in this case is expected because it means "no information available".[2]
2) This is not a kernel issue because kernel still provides the corresponding cpu information.
lscpu could get the expected information because lscpu retrives the
cache information in another way. lspcu gets the information via Linux
virtual filesystem, including /proc/cpuinfo and /sys/devices/system/cpu,
and these virtual devices/files provided by Linux kernel show the
corresponding kernel is working and working well.
I would suggest to use lscpu in your case to retrieve L2/L3 cache
information instead of getconf.
[1] According to the source code where getconf retrieves cpu cache information sysdeps/unix/sysv/linux/aarch64/sysconf.c:__sysconf
/* Unfortunately, the registers that contain the actual cache info
(CCSIDR_EL1, CLIDR_EL1, and CSSELR_EL1) are protected by the Linux
kernel (though they need not have been). However, CTR_EL0 contains
the *minimum* linesize in the entire cache hierarchy, and is
accessible to userland, for use in __aarch64_sync_cache_range,
and it is a reasonable assumption that the L1 cache will have that
minimum line size. */
[2] Please refer to the comments in this source file ./sysdeps/posix/sysconf.c:__sysconf
case _SC_LEVEL1_ICACHE_SIZE:
case _SC_LEVEL1_ICACHE_ASSOC:
case _SC_LEVEL1_ICACHE_LINESIZE:
case _SC_LEVEL1_DCACHE_SIZE:
case _SC_LEVEL1_DCACHE_ASSOC:
case _SC_LEVEL1_DCACHE_LINESIZE:
case _SC_LEVEL2_CACHE_SIZE:
case _SC_LEVEL2_CACHE_ASSOC:
case _SC_LEVEL2_CACHE_LINESIZE:
case _SC_LEVEL3_CACHE_SIZE:
case _SC_LEVEL3_CACHE_ASSOC:
case _SC_LEVEL3_CACHE_LINESIZE:
case _SC_LEVEL4_CACHE_SIZE:
case _SC_LEVEL4_CACHE_ASSOC:
case _SC_LEVEL4_CACHE_LINESIZE:
/* In general we cannot determine these values. Therefore we
return zero which indicates that no information is
available. */
return 0;
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to glibc in Ubuntu.
https://bugs.launchpad.net/bugs/1868028
Title:
L2\L3 cache display error for using "getconf -a" command"
Status in kunpeng920:
In Progress
Status in kunpeng920 ubuntu-18.04 series:
In Progress
Status in kunpeng920 ubuntu-18.04-hwe series:
New
Status in kunpeng920 ubuntu-18.10 series:
Invalid
Status in kunpeng920 ubuntu-20.04 series:
New
Status in kunpeng920 upstream-kernel series:
New
Status in glibc package in Ubuntu:
New
Bug description:
[Bug Description]
L2\L3 cache display error for using "getconf -a" command"
[Steps to Reproduce]
1)uname -a
2)getconf -a
[Actual Results]
getconf -a
GNU_LIBPTHREAD_VERSION NPTL 2.27
POSIX2_SYMLINKS 1
LEVEL1_ICACHE_SIZE 0
LEVEL1_ICACHE_ASSOC 0
LEVEL1_ICACHE_LINESIZE 64
LEVEL1_DCACHE_SIZE 0
LEVEL1_DCACHE_ASSOC 0
LEVEL1_DCACHE_LINESIZE 64
LEVEL2_CACHE_SIZE 0
LEVEL2_CACHE_ASSOC 0
LEVEL2_CACHE_LINESIZE 0
LEVEL3_CACHE_SIZE 0
LEVEL3_CACHE_ASSOC 0
LEVEL3_CACHE_LINESIZE 0
LEVEL4_CACHE_SIZE 0
LEVEL4_CACHE_ASSOC 0
LEVEL4_CACHE_LINESIZE 0
[Expected Results]
lscpu
CPU max MHz: 2600.0000
CPU min MHz: 200.0000
BogoMIPS: 200.00
L1d cache: 64K
L1i cache: 64K
L2 cache: 512K
L3 cache: 65536K
NUMA node0 CPU(s): 0-31
[Reproducibility]
[Additional information]
(Firmware version, kernel version, affected hardware, etc. if required):
[Resolution]
To manage notifications about this bug go to:
https://bugs.launchpad.net/kunpeng920/+bug/1868028/+subscriptions
More information about the foundations-bugs
mailing list