如果我从交流适配器上拔下笔记本电脑,我将收到如下 ACPI 错误:
May 07 21:45:04 veritas root[7067]: ACPI group/action undefined: processor / LNXCPU:00
May 07 21:45:04 veritas root[7076]: ACPI group/action undefined: processor / LNXCPU:01
May 07 21:45:04 veritas root[7078]: ACPI group/action undefined: processor / LNXCPU:02
May 07 21:45:04 veritas root[7080]: ACPI group/action undefined: processor / LNXCPU:03
acpi_listen
转储
ac_adapter ACPI0003:00 00000080 00000000
battery PNP0C0A:00 00000080 00000001
processor LNXCPU:00 00000080 00000015
processor LNXCPU:01 00000080 00000015
processor LNXCPU:02 00000080 00000015
processor LNXCPU:03 00000080 00000015
processor LNXCPU:00 00000081 00000000
processor LNXCPU:01 00000081 00000000
processor LNXCPU:02 00000081 00000000
processor LNXCPU:03 00000081 00000000
...
processor LNXCPU:00 00000080 00000000
processor LNXCPU:01 00000080 00000000
processor LNXCPU:02 00000080 00000000
processor LNXCPU:03 00000080 00000000
/etc/acpi/handler.sh
似乎没有处理处理器/LNXCPU 事件...
#!/bin/bash
# Default acpi script that takes an entry for all actions
case "$1" in
button/power)
case "$2" in
PBTN|PWRF)
logger 'PowerButton pressed'
;;
*)
logger "ACPI action undefined: $2"
;;
esac
;;
button/sleep)
case "$2" in
SLPB|SBTN)
logger 'SleepButton pressed'
;;
*)
logger "ACPI action undefined: $2"
;;
esac
;;
ac_adapter)
case "$2" in
AC|ACAD|ADP0)
case "$4" in
00000000)
logger 'AC unpluged'
;;
00000001)
logger 'AC pluged'
;;
esac
;;
*)
logger "ACPI action undefined: $2"
;;
esac
;;
battery)
case "$2" in
BAT0)
case "$4" in
00000000)
logger 'Battery online'
;;
00000001)
logger 'Battery offline'
;;
esac
;;
CPU0)
;;
*) logger "ACPI action undefined: $2" ;;
esac
;;
button/lid)
case "$3" in
close)
logger 'LID closed'
;;
open)
logger 'LID opened'
;;
*)
logger "ACPI action undefined: $3"
;;
esac
;;
*)
logger "ACPI group/action undefined: $1 / $2"
;;
esac
更糟糕的是,我会遇到严重的性能问题。 (一切都滞后!)我想这是由于处理器/LNXCPU的重复尝试造成的,因为性能问题与未定义的ACPI操作的错误密切相关,如果重新启动,性能将再次正常。
但是,我无法找出原因是什么......我尝试cpupower
控制CPU模式(省电或性能),并禁用tlp
,但两者都没有帮助。
这是怎么发生的?造成这个问题的原因是什么?更重要的是,我该如何解决这个问题?非常感谢!
跟进:我注意到CPU频率是400MHz(选择性能模式不起作用),但是重启后变成800MHz(选择性能模式频率为2.8GHz)。
答案1
如果我从交流适配器上拔下笔记本电脑,我会收到如下 ACPI 错误...
建议在:“ACPI 交流适配器插入/拔出无法识别”。
rzepaczyk - 我的 handler.sh:
# Default acpi script that takes an entry for all actions
minspeed=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq`
maxspeed=`cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq`
setspeed1="/sys/devices/system/cpu/cpu0/cpufreq/scaling_setspeed"
setspeed2="/sys/devices/system/cpu/cpu1/cpufreq/scaling_setspeed"
setspeed3="/sys/devices/system/cpu/cpu2/cpufreq/scaling_setspeed"
setspeed4="/sys/devices/system/cpu/cpu3/cpufreq/scaling_setspeed"
set $*
case "$1" in
button/power)
#echo "PowerButton pressed!">/dev/tty5
case "$2" in
PBTN|PWRF) logger "PowerButton pressed: $2" ;;
*) logger "ACPI action undefined: $2" ;;
esac
;;
button/sleep)
case "$2" in
SLPB) echo -n mem >/sys/power/state ;;
*) logger "ACPI action undefined: $2" ;;
esac
;;
ac_adapter)
case "$2" in
AC*|ACAD*|ADP0*|AD*)
case "$4" in
00000000)
echo -n $minspeed >$setspeed1
echo -n $minspeed >$setspeed2
echo -n $minspeed >$setspeed3
echo -n $minspeed >$setspeed4
#/etc/laptop-mode/laptop-mode start
;;
00000001)
echo -n $maxspeed >$setspeed1
echo -n $maxspeed >$setspeed2
echo -n $maxspeed >$setspeed3
echo -n $maxspeed >$setspeed4
#/etc/laptop-mode/laptop-mode stop
;;
esac
;;
*) logger "ACPI action undefined: $2" ;;
esac
;;
battery)
case "$2" in
BAT0)
case "$4" in
00000000) #echo "offline" >/dev/tty5
;;
00000001) #echo "online" >/dev/tty5
;;
esac
;;
CPU0)
;;
*) logger "ACPI action undefined: $2" ;;
esac
;;
button/lid)
case "$3" in
close)
#echo "LID closed!">/dev/tty5
;;
open)
#echo "LID opened!">/dev/tty5
;;
esac
;;
*)
logger "ACPI group/action undefined: $1 / $2"
;;
esac
我想做的是在插入适配器时将 cpu 调速器设置为 ondemand ,在拔下适配器时设置为 powersave 。我看到操作未定义,所以我假设 acpi 无法识别操作(即使这样:
ac_adapter)
case "$2" in
AC*|ACAD*|ADP0*|AD*)
)
handler.sh 中的条目。
Raynman - 看起来他们已经被处理了。除了日志中显示的未定义事件之外,acpi_listen 还显示 ac_adapter 事件。这些是由您上次报价中的案例处理的。然后,您还有另一个关于 $4 的 case 语句,用于区分插入 (00000001) 和拔出 (00000000)。如果您通过调用 cpufreq-set (或您能想到的其他任何内容)替换这些 echo 语句,它应该可以工作。
rzepaczyk - 它正在工作,感谢您的帮助。