What's the point of the cores check below? And how to deal with big.LITTLE CPUs?
@james-mcsherry 已经在做这个了。
开始于 2024年4月18日。
评估
这个 Issue 还没有评估数据。
描述
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
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)
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
- 主要语言
- Java
- 星标
- 1.9k
- 派生
- 367
- PR 合并指标
- 30 天内没有已合并 PR
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
OpenHFT/Java-Thread-Affinity 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 68/100
OpenHFT/Java-Thread-Affinity#203 · 1 条评论 ·
-
OpenHFT/Java-Thread-Affinity#186 · 已指派 1 人 ·
-
难度 5/5 一周以上 新手友好度 20/100
OpenHFT/Java-Thread-Affinity#137 ·
-
OpenHFT/Java-Thread-Affinity#117 · 8 条评论 · 已指派 1 人 ·
-
OpenHFT/Java-Thread-Affinity#115 · 1 条评论 · 已指派 1 人 ·
查看 OpenHFT/Java-Thread-Affinity 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
elastic/gradle-plugins#157 ·
-
enhancement Tools
难度 1/5 1 小时以内 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 70/100
apache/rocketmq-dashboard#5008 ·
-
bug
难度 2/5 1-3 小时 新手友好度 75/100
-
DETECT_PARAMETER_NAMES=false silently disables @ConstructorProperties-based Creator detection too 未关闭
难度 2/5 1-3 小时 新手友好度 70/100
FasterXML/jackson-databind#6229 ·