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
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1868028

Title:
  L2\L3 cache display  error for using "getconf -a" command"

To manage notifications about this bug go to:
https://bugs.launchpad.net/kunpeng920/+bug/1868028/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to