Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What's the point of the cores check below? And how to deal with big.LITTLE CPUs? #119

Open
d0zingcat opened this issue Apr 18, 2024 · 1 comment
Assignees

Comments

@d0zingcat
Copy link

d0zingcat commented Apr 18, 2024

We use this Library in JDK 8 on one dedicated server whose CPU is Intel i5-13500 and this CPU uses big.LITTLE architecture. It has 6 Performance cores(which implements HyperThread Technology and can be thought as two cores) and 8 Efficient cores. That is, the total of logic cores is 6*2 + 8 = 20 and the total of logic cores is 6+8=14.

If we use CPUAffinity to bind CPU core, we will have one exception which tells that the cores do not match: "java.lang.AssertionError: cpuDetails.size= 20 != sockets: 1 * coresPerSocket: 14 * threadsPerCore: 2"

I think it is due to this line: https://github.com/OpenHFT/Java-Thread-Affinity/blame/9a9148f9f5073cb4c8ff4a59804d3f7c74d84ce2/affinity/src/main/java/net/openhft/affinity/impl/VanillaCpuLayout.java#L55

image

Maybe the threadspercore should not multiple all the cores.

What's the point of this check and how to deal with this exception?

Refers:

Exception in thread "Thread-5" java.lang.NoClassDefFoundError: Could not initialize class net.openhft.affinity.AffinityLock
	at .core.utils.AffinityThreadFactory.getAffinityLockSync(AffinityThreadFactory.java:75)
	at .core.utils.AffinityThreadFactory.executePinned(AffinityThreadFactory.java:54)
	at .core.utils.AffinityThreadFactory.lambda$newThread$0(AffinityThreadFactory.java:48)
	at java.lang.Thread.run(Thread.java:748)
Exception in thread "Thread-3" java.lang.AssertionError: cpuDetails.size= 20 != sockets: 1 * coresPerSocket: 14 * threadsPerCore: 2
CpuInfo{socketId=0, coreId=0, threadId=0}
CpuInfo{socketId=0, coreId=0, threadId=1}
CpuInfo{socketId=0, coreId=4, threadId=0}
CpuInfo{socketId=0, coreId=4, threadId=1}
CpuInfo{socketId=0, coreId=8, threadId=0}
CpuInfo{socketId=0, coreId=8, threadId=1}
CpuInfo{socketId=0, coreId=12, threadId=0}
CpuInfo{socketId=0, coreId=12, threadId=1}
CpuInfo{socketId=0, coreId=16, threadId=0}
CpuInfo{socketId=0, coreId=16, threadId=1}
CpuInfo{socketId=0, coreId=20, threadId=0}
CpuInfo{socketId=0, coreId=20, threadId=1}
CpuInfo{socketId=0, coreId=24, threadId=0}
CpuInfo{socketId=0, coreId=25, threadId=0}
CpuInfo{socketId=0, coreId=26, threadId=0}
CpuInfo{socketId=0, coreId=27, threadId=0}
CpuInfo{socketId=0, coreId=28, threadId=0}
CpuInfo{socketId=0, coreId=29, threadId=0}
CpuInfo{socketId=0, coreId=30, threadId=0}
CpuInfo{socketId=0, coreId=31, threadId=0}

	at net.openhft.affinity.impl.VanillaCpuLayout.<init>(VanillaCpuLayout.java:63)
	at net.openhft.affinity.impl.VanillaCpuLayout.fromCpuInfo(VanillaCpuLayout.java:142)
	at net.openhft.affinity.impl.VanillaCpuLayout.fromCpuInfo(VanillaCpuLayout.java:100)
	at net.openhft.affinity.impl.VanillaCpuLayout.fromCpuInfo(VanillaCpuLayout.java:95)
	at net.openhft.affinity.AffinityLock.<clinit>(AffinityLock.java:56)

The spec: https://www.intel.com/content/www/us/en/products/sku/230580/intel-core-i513500-processor-24m-cache-up-to-4-80-ghz/specifications.html

lscpu:

Architecture:            x86_64
  CPU op-mode(s):        32-bit, 64-bit
  Address sizes:         46 bits physical, 48 bits virtual
  Byte Order:            Little Endian
CPU(s):                  20
  On-line CPU(s) list:   0-19
Vendor ID:               GenuineIntel
  BIOS Vendor ID:        Intel(R) Corporation
  Model name:            13th Gen Intel(R) Core(TM) i5-13500
    BIOS Model name:     13th Gen Intel(R) Core(TM) i5-13500 To Be Filled By O.E.M. CPU @ 2.4GHz
    BIOS CPU family:     205
    CPU family:          6
    Model:               191
    Thread(s) per core:  2
    Core(s) per socket:  14
    Socket(s):           1
    Stepping:            2
    CPU(s) scaling MHz:  20%
    CPU max MHz:         4800.0000
    CPU min MHz:         800.0000
    BogoMIPS:            4992.00
    Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl
                          xtopology nonstop_tsc cpuid aperfmperf tsc_known_freq pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave a
                         vx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid rdseed adx 
                         smap clflushopt clwb intel_pt sha_ni xsaveopt xsavec xgetbv1 xsaves avx_vnni dtherm ida arat pln pts hwp hwp_notify hwp_act_window hwp_epp hwp_pkg_req hfi umip pku ospke waitpkg gfni vaes vpclmulqdq tm
                         e rdpid movdiri movdir64b fsrm md_clear serialize pconfig arch_lbr ibt flush_l1d arch_capabilities
Virtualization features: 
  Virtualization:        VT-x
Caches (sum of all):     
  L1d:                   544 KiB (14 instances)
  L1i:                   704 KiB (14 instances)
  L2:                    11.5 MiB (8 instances)
  L3:                    24 MiB (1 instance)
NUMA:                    
  NUMA node(s):          1
  NUMA node0 CPU(s):     0-19
Vulnerabilities:         
  Gather data sampling:  Not affected
  Itlb multihit:         Not affected
  L1tf:                  Not affected
  Mds:                   Not affected
  Meltdown:              Not affected
  Mmio stale data:       Not affected
  Retbleed:              Not affected
  Spec rstack overflow:  Not affected
  Spec store bypass:     Mitigation; Speculative Store Bypass disabled via prctl
  Spectre v1:            Mitigation; usercopy/swapgs barriers and __user pointer sanitization
  Spectre v2:            Mitigation; Enhanced IBRS, IBPB conditional, RSB filling, PBRSB-eIBRS SW sequence
  Srbds:                 Not affected
  Tsx async abort:       Not affected
@tgd
Copy link
Contributor

tgd commented Apr 19, 2024

Hi @d0zingcat - thanks for flagging this with us - we will start taking a look at this report next week and come back with some more info.

In the meantime if you would like expedited commercial support we offer a number of options here: https://chronicle.software/contact-us/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants