Dell Latitude E6540 (2014) ... Intel i7-4600M
Problem seems related to new after market battery, load shedding when the power comes on and off (also when I start the generator, etc.) The state of tlp changes from AC to battery and it also affects the governor. It seems that all the detail for the battery is not properly detected when the battery is 100% charged (tlp-stat -b shows the capacity as not available ... but when it is at less than 100% it displays it correctly.)
I tried to disable the Intel "C States" in the BIOS as well as /etc/default/grub: GRUB_CMDLINE_LINUX_DEFAULT="intel_idle.max_cstate=0"
but the fix did not last.
I watch Frequencies with: watch -n 0.3 "cat /proc/cpuinfo | grep MHz"
fwiiw
I also apt purged: linux-tools-* cpufreq* gamemode*
So what does currently work is (when the battery is not at 100%) then I use the underneath script to play around and that seems to fix the cpu scaling (on kernel 6.2)
Faster way to try and tune stuff:
su -
./manage_governor.sh
#================================================================================
#!/bin/bash
Dell Latitude E6540 (2014) ... Intel i7-4600M
Problem seems related to new after market battery, load shedding when the power comes on and off (also when I start the generator, etc.) The state of tlp changes from AC to battery and it also affects the governor. It seems that all the detail for the battery is not properly detected when the battery is 100% charged (tlp-stat -b shows the capacity as not available ... but when it is at less than 100% it displays it correctly.)
I tried to disable the Intel "C States" in the BIOS as well as /etc/default/grub: GRUB_CMDLINE_ LINUX_DEFAULT= "intel_ idle.max_ cstate= 0"
but the fix did not last.
I watch Frequencies with: watch -n 0.3 "cat /proc/cpuinfo | grep MHz"
fwiiw
I also apt purged: linux-tools-* cpufreq* gamemode*
So what does currently work is (when the battery is not at 100%) then I use the underneath script to play around and that seems to fix the cpu scaling (on kernel 6.2)
Faster way to try and tune stuff: governor. sh ======= ======= ======= ======= ======= ======= ======= ======= ======= ======= ====
su -
./manage_
#======
#!/bin/bash
reserv () { daemon. service ;
systemctl restart acpid.service ;
systemctl restart lm-sensors.service ;
systemctl restart machine.slice ;
systemctl restart power-profiles-
systemctl restart gpu-manager.service ;
systemctl restart powertop.service ;
systemctl restart thermald.service ;
systemctl restart tuned.service ;
systemctl restart tlp.service ;
upower -d ;
tlp recalibrate ;
tlp-stat -b ;
}
GOV=`cat /sys/devices/ system/ cpu/cpu0/ cpufreq/ scaling_ governor` ;
govdrv () { system/ cpu/cpu* /cpufreq/ scaling_ driver ;
echo "current driver: ";
grep . /sys/devices/
}
govtuning () { system/ cpu/cpufreq/ $GOV/* " ; system/ cpu/cpufreq/ $GOV/* ;
echo "current tuning parameters of $GOV governor:
grep . /sys/devices/
grep . /sys/devices/
}
getgov () { system/ cpu/cpu* /cpufreq/ scaling_ governor ; system/ cpu/cpu0/ cpufreq/ scaling_ available_ governors ;
echo "current governor: ";
grep . /sys/devices/
echo "available governors: " ;
cat /sys/devices/
}
setgov () { system/ cpu/cpu0/ cpufreq/ scaling_ governor ; system/ cpu/cpu1/ cpufreq/ scaling_ governor ; system/ cpu/cpu2/ cpufreq/ scaling_ governor ; system/ cpu/cpu3/ cpufreq/ scaling_ governor ;
getgov ;
read -p " watter governor wil jy apply ? ... " GOV ;
echo $GOV > /sys/devices/
echo $GOV > /sys/devices/
echo $GOV > /sys/devices/
echo $GOV > /sys/devices/
getgov ;
}
watchfreq () {
watch -n 0.3 "cat /proc/cpuinfo |grep MHz" ;
}
tunegov () { ======= ======= ======= ======= ======= ======= =====" ; system/ cpu/cpufreq/ conservative/ up_threshold ; system/ cpu/cpufreq/ conservative/ up_threshold ; system/ cpu/cpufreq/ conservative/ up_threshold ;
echo "======
grep . /sys/devices/
echo "setting conservative governor up_threshold to 40%: " ;
echo -n 40 > /sys/devices/
grep . /sys/devices/
echo "====== ======= ======= ======= ======= ======= ======= =====" ; system/ cpu/cpufreq/ conservative/ sampling_ down_factor ; down_factor to 2: " ; system/ cpu/cpufreq/ conservative/ sampling_ down_factor ; system/ cpu/cpufreq/ conservative/ sampling_ down_factor ; ======= ======= ======= ======= ======= ======= =====" ;sleep 1 ;
grep . /sys/devices/
echo "setting sampling_
echo -n 2 > /sys/devices/
grep . /sys/devices/
echo "======
}
echo " lib/udev/ rules.d/ 85-tlp. rules
============== also see =============
man tlp ... tlp-stat -h
/usr/
dmidecode ... lscpu ... hwinfo" ;
while true ======= ======= ======= ======= ======= ======= ======= ======= ======= ==
do
echo -n "
=======
[rs] restart-services [wf] watchfreq [gd] govdrv
[gg] getgov [sg] setgov [gt] govtuning [tg] tunegov
[ts] tlp? [tb] tlpbat [pd] powr? [q] quit ? " ;
read keuse ;
case $keuse in
rs) reserv ;;
gg) getgov ;;
sg) setgov ;;
gd) govdrv ;;
gt) govtuning ;;
tg) tunegov ;;
wf) watchfreq ;;
ts) tlp-stat -s ;;
tb) tlp-stat -b ;;
pd) upower -d | less ;;
q) exit ;;
esac
done
#====== ======= ======= ======= ======= ======= ======= ======= ======= ======= ======= ====