┌──[root@liruilongs.github.io]-[~] └─$ ethtool -s eth0 wol d ┌──[root@liruilongs.github.io]-[~] └─$ ethtool eth0 Settings for eth0: Supported ports: [ TP ] Supported link modes: 1000baseT/Full 10000baseT/Full Supported pause frame use: No Supports auto-negotiation: No Supported FEC modes: Not reported Advertised link modes: Not reported Advertised pause frame use: No Advertised auto-negotiation: No Advertised FEC modes: Not reported Speed: 10000Mb/s Duplex: Full Port: Twisted Pair PHYAD: 0 Transceiver: internal Auto-negotiation: off MDI-X: Unknown Supports Wake-on: uag Wake-on: d Link detected: yes ┌──[root@liruilongs.github.io]-[~] └─$
atime Do not use the noatime feature, so the inode access time is controlled by kernel defaults. See also the descriptions of the relatime and strictatime mount options.
noatime Do not update inode access times on this filesystem (e.g. for faster access on the news spool to speed up news servers). This works for all inode types (directories too), so it implies nodiratime.
启用方式
1 2
┌──[root@liruilongs.github.io]-[~] └─$ mount -o remount,noatime /dev/mapper/rhel-home /home
interactive:交互模式,直接上最高频率,然后看CPU负荷慢慢降低,比较耗电。Interactive 是以 CPU 排程数量而调整频率,从而实现省电。InteractiveX 是以 CPU 负载来调整 CPU 频率,不会过度把频率调低。所以比 Interactive 反应好些,但是省电的效果一般。
┌──[root@liruilongs.github.io]-[/sys/devices/system/cpu/cpu0] └─$ cpupower frequency-set -g ondemand Setting cpu: 0 Error setting new values. Common errors: - Do you have proper administration rights? (super-user?) - Is the governor you requested available and modprobed? - Trying to set an invalid policy? - Trying to set a specific frequency, but userspace governor is not available, for example because of hardware which cannot be set to a specific frequency or because the userspace governor isn't loaded?
查frequency-info信息,发现调频的信息都没有
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
┌──[root@liruilongs.github.io]-[/sys/devices/system/cpu/cpu0] └─$ cpupower frequency-info analyzing CPU 0: no or unknown cpufreq driver is active on this CPU CPUs which run at the same hardware frequency: Not Available CPUs which need to have their frequency coordinated by software: Not Available maximum transition latency: Cannot determine or is not supported. hardware limits: Not Available available cpufreq governors: Not Available Unable to determine current policy current CPU frequency: Unable to call hardware current CPU frequency: Unable to call to kernel boost state support: Supported: no Active: no Boost States: 0 Total States: 1 Pstate-P0: 1600MHz
可能是调频模块没有启动,我们来看下。
1 2 3 4
┌──[root@liruilongs.github.io]-[/sys/devices/system/cpu/cpu0] └─$ cd /sys/devices/system/cpu/cpu0;ls cache crash_notes_size firmware_node node0 subsystem uevent crash_notes driver microcode power topology
确实么有名为cpufreq的文件夹,然后我们看一下我的CUP信息
1 2 3 4 5 6
┌──[root@liruilongs.github.io]-[/sys/devices/system/cpu/cpu0] └─$ cat /proc/cpuinfo | grep name model name : AMD Ryzen 7 2700U with Radeon Vega Mobile Gfx model name : AMD Ryzen 7 2700U with Radeon Vega Mobile Gfx ┌──[root@liruilongs.github.io]-[/sys/devices/system/cpu/cpu0] └─$
┌──[root@liruilongs.github.io]-[/lib/modules/4.18.0-193.el8.x86_64/kernel/drivers/cpufreq] └─$ modprobe powernow-k8 modprobe: ERROR: could not insert 'powernow_k8': No such device
还是不行,时间关系这里做简单记录,感兴趣小伙伴在研究下,看文档需要系统 BIOS 配置为允许操作系统控制 CPU 电源管理
1 2 3 4 5
┌──[root@liruilongs.github.io]-[/usr/lib/modules/4.18.0-193.el8.x86_64/kernel/drivers/cpufreq] └─$ modprobe powernow-k8 modprobe: ERROR: could not insert 'powernow_k8': No such device ┌──[root@liruilongs.github.io]-[/usr/lib/modules/4.18.0-193.el8.x86_64/kernel/drivers/cpufreq] └─$
┌──[root@liruilongs.github.io]-[/sys/class/scsi_host/host0] └─$ tuned-adm list | grep powersave - powersave - Optimize for low power consumption ┌──[root@liruilongs.github.io]-[/sys/class/scsi_host/host0] └─$ tuned-adm profile powersave ┌──[root@liruilongs.github.io]-[/sys/class/scsi_host/host0] └─$ tuned-adm active Current active profile: powersave
配置功率使用powertop
PowerTOP 是一个笔记本电脑节省电源的 Linux 工具。此工具由 Intel 公司发布。它可以帮助用户找出那些耗电量大的程序,通过修复或者关闭那些应用程序或进程,从而为用户节省电源。
PowerTOP 要求 Linux 内核开启 tickless idle 功能,具备 2.6.21 及以上版本。另外,PowerTOP 工作的最佳平台为笔记本电脑。
--auto-tune sets all tunable options to their GOOD setting -c, --calibrate runs powertop in calibration mode -C, --csv[=filename] generate a csv report --debug run in"debug" mode --extech[=devnode] uses an Extech Power Analyzer for measurements -r, --html[=filename] generate a html report -i, --iteration[=iterations] number of times to run each test -q, --quiet suppress stderr output -s, --sample[=seconds] interval for power consumption measurement -t, --time[=seconds] generate a report for'x' seconds -w, --workload[=workload] file to execute for workload -V, --version print version information -h, --helpprint this help menu
For more help please refer to the 'man 8 powertop'
Tunables 分页为调优选择
请使用 Tab, Shift + Tab 或方向键 ←, → 切换至 Tunables 分页 ↑, ↓ 上下移动,于欲调校的项目按下 Enter 进行调校,当所有状态显示为 Good 后即可按下 q 离开。
也可以通过命令来批量设置
1 2 3 4 5 6 7 8 9 10 11
┌──[root@liruilongs.github.io]-[~] └─$ powertop --auto-tune modprobe cpufreq_stats failedLoaded 0 prior measurements RAPL device for cpu 0 RAPL device for cpu 0 Devfreq not enabled glob returned GLOB_ABORTED the port is sda Leaving PowerTOP ┌──[root@liruilongs.github.io]-[~] └─$
┌──[root@liruilongs.github.io]-[~] └─$ powertop --html modprobe cpufreq_stats failedLoaded 0 prior measurements RAPL device for cpu 0 RAPL device for cpu 0 Devfreq not enabled glob returned GLOB_ABORTED Preparing to take measurements Taking 1 measurement(s) for a duration of 20 second(s) each. the port is sda PowerTOP outputing using base filename powertop.html