I had the same behaviour on my T60p and X60t, thinkpad-keys using ~2% cpu at 
all times:
  $ uptime ; ps aux | awk '/[t]hinkpad-keys/{print$11,$10}'
   12:37:57 up 6 days, 19:39,  1 user,  load average: 0.17, 0.14, 0.11
  /usr/sbin/thinkpad-keys 189:07

The attached patch bundles the 4 read+seek operations into one (10 byte read),
as well increasing POLL_DELAY to 100ms.
As a result thinkpad-keys drops off the top(1) charts entirely.
Additionally, the Makefile is fixed to forward CFLAGS, and call CC with default 
-02.

Tested on: T60p, X60t (Feisty, 2.6.20-lowlatency kernel), A30p (Edgy).
The A30p did not exhibit this behaviour, but applying the patch did not do any 
harm either.

Applies to latest release (0.1-17ubuntu9).
  cd hotkey-setup-0.1
  patch < hotkey-setup_0.1-17ubuntu9_optimize+CFLAGS.patch


DISCLAIMER: I have no knowledge of the inner workings of /dev/nvram, but this 
seems to work for me...
Also, this is my first patch here, so constructive criticism are very welcome.


** Attachment added: "bundle nvram reads, POLL_DELAY 100ms, add DEBUG define, 
default -O2"
   
http://librarian.launchpad.net/7398541/hotkey-setup_0.1-17ubuntu9_CFLAGS.patch

-- 
thinkpad-keys on ThinkPad X60* uses a large amount of CPU
https://bugs.launchpad.net/bugs/45404
You received this bug notification because you are a member of Ubuntu
Bugs, which is a direct subscriber.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to