romu
|
2016-01-13
, 10:29
|
Posts: 602 |
Thanked: 735 times |
Joined on Mar 2011
@ Nantes, France
|
#371
|
|
2016-01-13
, 10:37
|
Posts: 575 |
Thanked: 621 times |
Joined on May 2010
|
#372
|
|
2016-01-13
, 22:51
|
|
Posts: 654 |
Thanked: 2,368 times |
Joined on Jul 2014
@ UK
|
#373
|
|
2016-01-14
, 01:11
|
|
Posts: 6,447 |
Thanked: 20,981 times |
Joined on Sep 2012
@ UK
|
#374
|
|
2016-01-14
, 04:47
|
Posts: 205 |
Thanked: 389 times |
Joined on Nov 2009
|
#375
|
|
2016-01-14
, 07:02
|
Posts: 334 |
Thanked: 616 times |
Joined on Sep 2010
|
#376
|
The Following User Says Thank You to Manatus For This Useful Post: | ||
|
2016-01-14
, 07:46
|
Posts: 575 |
Thanked: 621 times |
Joined on May 2010
|
#377
|
C Smith 2016-01-09 07:40:27 UTC
I wrote a python "daemon" which works around the problem. It reduces CPU usage by restarting sensors when it misbehaves. My source is attached here. (I don't have another way of distributing it so someone please post it on a web server for me.)
The script is called: sensors-cpu-watchdog.py
It wakes up every 30 seconds and checks if sensors.qcom is "running away". if this problem persists for 2 minutes then the script does:
systemctl restart sensorfwd
and the problem goes away, sensors use less than 1% CPU again (the sensorfwd restart is harmless). Polling is ugly but low overhead, and is way better than allowing sensors to consume 25% CPU all day long.
Dependencies: must install psutil python lib.
I used psutil-3.3.0.tar.gz and installed it per its instructions.
put sensors-cpu-watchdog.py in /usr/local/bin
put sensors-cpu-watchdog.service into /lib/systemd/system/basic.target.wants/
Then you can do things like:
systemctl restart sensors-cpu-watchdog.service
systemctl status sensors-cpu-watchdog.service
do:
ps ax |grep watchdog
and you should see something like:
470 ? Ss 0:16 /usr/bin/python /usr/local/bin/sensors-cpu-watchdog.py &
Note that I can pretty reliably reproduce the high CPU usage by sensors.qcom and sensorfwd, where both use around 13% CPU. All I have to do is unblank by pressing power button, and then swipe in from the right side.
The Following 2 Users Say Thank You to clovis86 For This Useful Post: | ||
|
2016-01-14
, 08:47
|
Posts: 602 |
Thanked: 735 times |
Joined on Mar 2011
@ Nantes, France
|
#378
|
|
2016-01-14
, 10:38
|
Posts: 69 |
Thanked: 85 times |
Joined on Mar 2013
|
#380
|
I saw yesterday a workaround regarding bettery life and sensors on bugzzilla :
https://bugs.nemomobile.org/show_bug.cgi?id=837