Since
PowerTOP was released, I noticed that the number of wakeups on my Thinkpad T60p were excessively high. Usually they were around the 350 mark, even without much running, leading to about 3.5 hours battery life or about an hour less than Windows XP. Even with disabling non-essential services, hardware and following other suggestions dotted around sites like
lesswatts.org and
thinkwiki.org, power usage was roughly 23-26 watts (might be off, I didn't record data in detail). I decided to take a closer look. Basically, almost all processes using X were waking up constantly with strace patterns looking vaguely like;
poll([{fd=4, events=POLLIN}, {fd=3, events=POLLIN}, {fd=8, events=POLLIN|POLLPRI},
{fd=12, events=POLLIN|POLLPRI}, {fd=13, events=POLLIN|POLLPRI},
{fd=14, events=POLLIN|POLLPRI}, {fd=17, events=POLLIN},
{fd=11, events=POLLIN|POLLPRI}, {fd=16, events=POLLIN}], 9, 499) = 0
gettimeofday({1200178170, 948253}, NULL) = 0
ioctl(3, FIONREAD, [0]) = 0
gettimeofday({1200178170, 948443}, NULL) = 0
poll([{fd=4, events=POLLIN}, {fd=3, events=POLLIN}, {fd=8, events=POLLIN|POLLPRI},
{fd=12, events=POLLIN|POLLPRI}, {fd=13, events=POLLIN|POLLPRI},
{fd=14, events=POLLIN|POLLPRI}, {fd=17, events=POLLIN},
{fd=11, events=POLLIN|POLLPRI}, {fd=16, events=POLLIN}], 9, 0) = 0
write(3, "\211\1\1\0", 4) = 4
read(3, "\1\0\340\0\0\0\0\0\1\0\0\0\0\0\0\0\4\0\0\0(\0\0\0\4\0\0"..., 32) = 32
write(3, "\211\7\1\0", 4) = 4
read(3, "\1\0\341\0\0\0\0\0\0\0\1\0\0\0\0\0\4\0\0\0(\0\0\0\4\0\0"..., 32) = 32
ioctl(3, FIONREAD, [0]) = 0
gettimeofday({1200178170, 949286}, NULL) = 0
Similar patterns were seen in the other processes. They were all waking up and examining the same file descriptor which turned out to be a socket /tmp/.X11-unix/X0 in the control of X. I did not look closely but made the assumption that processes were polling some sort of event queue. Knowing that a lot of fixes of this sort of nature have been worked on, I decided to try out Debian Testing. As I was already running it on my desktop, I was reasonably sure the upgrade would be smooth enough. Font settings got mucked up as well as locales but as dist-upgrades go, it was pretty smooth.
Power-wise, it made a big difference. Even with wireless running, wakeups went from around 350 and 23 watts to 150 and 19 watts. There are still processes waking up in similar style of loops but they are a lot less infrequent (once every 1-4 seconds instead of many times per second). X was showing up high in the list with calls to
do_setitimer() so I applied this
patch to the xserver-xorg-core package and installed it made the problem go away. Annoyingly, i8042 was causing a large number of interrupts even when nothing was happening. Adding
i8042.nomux i8042.reset to the kernel boot command-line removed most of these wakups once the machine sits idle. Wakeups were down to 50 and 18.2 watts usage with the most common wakeup being the wireless. Turning off wireless and it's down to 36 wakeups, almost a tenth of what it was with Debian Etch and battery life is comparable with Windows XP. There are still a few anomalies but clearly things are going the right direction.