Bug 29289 - riscv架构下lscpu的socket显示问题修复
Summary: riscv架构下lscpu的socket显示问题修复
Status: NEW
Alias: None
Product: Anolis OS 23
Classification: Anolis OS
Component: BaseOS Modules (show other bugs) BaseOS Modules
Version: unspecified
Hardware: All Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: gaochang
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-01-06 10:35 UTC by gaorui
Modified: 2026-01-06 14:46 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description gaorui 2026-01-06 10:35:34 UTC
Description of problem:
如果cpuid_topo->package_id已在前序流程中被赋值则直接更新core_siblings,这里发现ARM64架构前面有通过从PPTT表获取Socket数量赋值package_id,但是当前RISCV架构前面没有从PPTT表获取Socket数量赋值package_id

如果cpuid_topo->package_id在前序未被赋值,则通过cpu_to_node(cpuid)获取,该信息为每个CPU所在的numa node,当前配置为2 numa配置,故 package_id有两个不同值1和0,所以最后lscpu显示的Socket(s)数量为2。RISCV架构当前走的是这个分支获取的numa node节点数量给到Socket数量。

~ # grep . /sys/devices/system/cpu/cpu*/topology/physical_*
/sys/devices/system/cpu/cpu0/topology/physical_package_id:1
/sys/devices/system/cpu/cpu1/topology/physical_package_id:1
/sys/devices/system/cpu/cpu2/topology/physical_package_id:1
/sys/devices/system/cpu/cpu3/topology/physical_package_id:1
/sys/devices/system/cpu/cpu4/topology/physical_package_id:0
/sys/devices/system/cpu/cpu5/topology/physical_package_id:0
/sys/devices/system/cpu/cpu6/topology/physical_package_id:0
/sys/devices/system/cpu/cpu7/topology/physical_package_id:0

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:
Comment 1 小龙 admin 2026-01-06 14:46:39 UTC
The PR Link: https://gitee.com/anolis/cloud-kernel/pulls/6297