Skip to the content.

sysfs cpu

/sys/devices/system/cpu

drivers/base/cpu.c 中的:

static struct attribute *cpu_root_attrs[] = {
#ifdef CONFIG_ARCH_CPU_PROBE_RELEASE
	&dev_attr_probe.attr,
	&dev_attr_release.attr,
#endif
	&cpu_attrs[0].attr.attr,
	&cpu_attrs[1].attr.attr,
	&cpu_attrs[2].attr.attr,
	&dev_attr_kernel_max.attr,
	&dev_attr_offline.attr,
	&dev_attr_enabled.attr,
	&dev_attr_isolated.attr,
#ifdef CONFIG_NO_HZ_FULL
	&dev_attr_nohz_full.attr,
#endif
#ifdef CONFIG_CRASH_HOTPLUG
	&dev_attr_crash_hotplug.attr,
#endif
#ifdef CONFIG_GENERIC_CPU_AUTOPROBE
	&dev_attr_modalias.attr,
#endif
	NULL
};
/* Keep in sync with cpu_subsys_attrs */
static struct cpu_attr cpu_attrs[] = {
	_CPU_ATTR(online, &__cpu_online_mask),
	_CPU_ATTR(possible, &__cpu_possible_mask),
	_CPU_ATTR(present, &__cpu_present_mask),
};

和这些都是可以完整的对应上的:

[!NOTE] 参考神奇海螺的意见,有待验证

(不过根据文档生成的,精度应该还可以的)

 cup0

(常规内容)

(有意思,但是现在不看)

  1. 接口路径: /sys/devices/system/cpu/cpu/cpuidle/state/ (其中 N 是 CPU 编号,M 是空闲状态编号)
    • above: 此空闲状态被请求但观察到的空闲时间肯定短于其目标驻留时间的次数。
    • below: 此空闲状态被请求但观察到的空闲时间肯定更适合更深状态的次数。
    • desc: 空闲状态的描述。
    • disable: 是否禁用此空闲状态。
    • default_status: 此状态的默认状态 (“enabled” 或 “disabled”)。
    • latency: 空闲状态的退出延迟(微秒)。
    • name: 空闲状态的名称。
    • power: (文档截断,可能包含功率相关数据)
    • time: CPU 在此空闲状态花费的总时间(纳秒)。
    • usage: 此空闲状态被请求的总次数。
  2. Intel 性能与能耗偏置提示 (Intel EPB - Energy Performance Bias) 接口路径: /sys/devices/system/cpu/cpu/power/ (其中 N 是 CPU 编号)
    • energy_perf_bias: 显示或设置此 CPU 的 EPB 值(0-15 数字或字符串),用于指示性能/能耗偏好。
  3. thermal_throttle 下的
    •  core_throttle_count
    •  core_throttle_max_time_ms
    •  core_throttle_total_time_ms
    •  package_throttle_count
    •  package_throttle_max_time_ms
    •  package_throttle_total_time_ms

[!NOTE] 参考神奇海螺的意见,有待验证

(似乎是这么回事)

 cpufreq

 cpuidle

全局 CPUIdle 接口路径

 intel_pstate

 intel_uncore_frequency

Intel Uncore 频率调节 (Intel Uncore Frequency Scaling)

 umwait_control

enable_c02 max_time

关联文件 arch/x86/kernel/cpu/umwait.c

和电源无关的内容,可以后面再说吧:

常用的总结

cat /sys/devices/system/cpu/cpufreq/policy0/scaling_driver cat /sys/devices/system/cpu/cpuidle/current_driver

问题?

thread_siblings_list

/sys/devices/system/node/node7/cpu255/topology/thread_siblings_list

怎么还有 node 的这个路径啊

本站所有文章转发 CSDN 将按侵权追究法律责任,其它情况随意。