Red Hat Bugzilla – Bug 313381
wpa_supplicant wakes up the cpu
Last modified: 2008-03-26 10:05:11 EDT
According to powertop wpa_supplicant is waking up the cpu 1.5 times per second:
Wakeups-from-idle per second : 15,9 interval: 15,0s
Top causes for wakeups:
27,3% ( 2,0) <kernel core> : clocksource_register (clocksource_watchdog)
20,0% ( 1,5) wpa_supplicant : schedule_timeout (process_timeout)
7,3% ( 0,5) gnome-terminal : schedule_timeout (process_timeout)
3,6% ( 0,3) <kernel module> : neigh_table_init_no_netlink
3,6% ( 0,3) <kernel core> : neigh_table_init_no_netlink
3,6% ( 0,3) nautilus : schedule_timeout (process_timeout)
3,6% ( 0,3) avahi-daemon : schedule_timeout (process_timeout)
2,7% ( 0,2) X : do_setitimer (it_real_fn)
2,7% ( 0,2) gedit : schedule_timeout (process_timeout)
2,7% ( 0,2) mapping-daemon : schedule_timeout (process_timeout)
2,7% ( 0,2) NetworkManager : __netdev_watchdog_up (dev_watchdog)
2,7% ( 0,2) init : schedule_timeout (process_timeout)
2,7% ( 0,2) sendmail : schedule_timeout (process_timeout)
2,7% ( 0,2) gnome-panel : schedule_timeout (process_timeout)
1,8% ( 0,1) gnome-power-man : schedule_timeout (process_timeout)
As shown above, besides the kernel, wpa_supplicant is the only one waking up the
cpu more than one time per second running my Gnome desktop on an updated Rawhide
system as of today.
Packages versions are:
Is there something that can be done to solve this?
Created attachment 221641 [details]
Lightly tested fix against 0.5.7
I also see it, though at 1.0 wakeups/sec. I tried to fix it but the source is
hard to understand :-(. It probably wouldn't be too hard to find where it
says "1 second", change it to "5 seconds" and see if it still works.
There's no fundamentally good reason for it to wake up - if you strace the
daemon you'll see the only system call it makes is the select() call that it
sleeps on. I'm sure it's not polling information from the kernel, just doing
some internal book-keeping.
Patch Works For Me (tm). Might eat children, who knows, but should at least
point out the problem.
Warning: After testing this patch my machine went up to 320 wakeups/s with no
reason shown on powertop. I've not experienced this before and it could be
connected to my patch.
Alan; any chance you could push the patch to the hostap lists? http://w1.fi is
the site; if you don't want to I could probably try to push it up.
Created attachment 221841 [details]
Slightly more tested fix
The previous one only stopped wpa_supplicant showing up on powertop because it
turned it into a busy loop :-).
This one is slightly less radical in it's aim. It still uses a regular timer
tick, but it shuts it down once no timers are active. On my setup, this means
wpa_supplicant stops showing up about 15 seconds after it's started.
The obstacle to removing the regular timer tick and only waking up when an
individual timer expires is that timers can be adjusted. If a timer is enabled
while a different timer has yet to expire, you have to work out how long is
left on the existing timer, in order to find which timer will expire first. If
you rely on the system clock, "date -s" will cause problems. The only widely
available *monotonic* clock appears to be times(2).
Dan: I'm on it. I added a bug there in parallel with posting on this one.
I've still got to rebase it off their current version, then I won't mind
squawking on the ML if they don't pick up the bug.
OK, they've implemented this now (my patch wasn't perfect and they re-wrote
it). Unfortunately their Bugzilla is down right now, but if you pull the
latest from their GIT repo and use that, the wakeups should be gone.
This should be fixed in rawhide since we're using a dev release with your
yup, we're using 0.6.3 from early march