Page MenuHomeFreeBSD

Reduce wpa_supplicant sleep
ClosedPublic

Authored by cy on Jun 12 2022, 2:56 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Oct 9, 8:57 PM
Unknown Object (File)
Sep 17 2024, 11:06 AM
Unknown Object (File)
Sep 17 2024, 10:49 AM
Unknown Object (File)
Sep 3 2024, 12:10 AM
Unknown Object (File)
Sep 2 2024, 4:49 AM
Unknown Object (File)
Sep 1 2024, 1:42 AM
Unknown Object (File)
Sep 1 2024, 1:42 AM
Unknown Object (File)
Sep 1 2024, 1:42 AM
Subscribers

Details

Summary

To reduce boot time, reduce the wpa_suplicant sleep from two seconds to half a second.

Removing the sleep entirely significantly increases the time dhclient needs to open the interface in order to obtain an IP address. However reducing the sleep to 0.5 seconds reduces boot time while still allowing dhclient to quickly open the interface.

Test Plan

Tested locally.

I have tested no sleep, which causes significant dhclient delays while 0.5 is a little better than 0.3 -- simply by counting the dots when dhclient is running.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

cy requested review of this revision.Jun 12 2022, 2:56 PM
This revision is now accepted and ready to land.Jun 12 2022, 5:31 PM

for completeness it is still better without sleep at all for me ;), I reducing to .5 is still better than the sleep 2:
with .5:
https://bapt.nours.eu/flame4.svg
without anythinng:
https://bapt.nours.eu/flame5.svg

I have tested no sleep, which causes significant dhclient delays

Is this because dhclient sends its first request before the interface is running? It would be good to track down what's happening here rather than simply saying "0.5 seconds works for me".

(I'm not objecting to the change from 2 to 0.5, just hoping someone will keep investigating after this is committed.)

Let's try removing the sleep for a month before MFCing it. The small delay may be due to my iwn(4) chipset.

Alternative may be an rc.conf tunable.

This revision now requires review to proceed.Jun 12 2022, 7:06 PM

I have tested no sleep, which causes significant dhclient delays

Is this because dhclient sends its first request before the interface is running? It would be good to track down what's happening here rather than simply saying "0.5 seconds works for me".

(I'm not objecting to the change from 2 to 0.5, just hoping someone will keep investigating after this is committed.)

I noticed the delay when performing service netif restart (or stop, wait for a while, then start). However a warm boot doesn't exhibit the delay. I suspect the problem is somewhere in wpa_supplicant. The delay never occurs when wlan(4) is part of a lagg(4).

Proposed commit log message:

rc.d/wpa_supplicant: Remove the sleep to improve boot time

bapt@ had discovered a noticeable boot improvement without the sleep.
Without the sleep does not affect warm or cold boot however a
service netif restart may cause dhclient to spend a few extra seconds
to rerequest the DHCP request.

Reported by: bapt
Reviewed by: bapt (previous version)
MFC after: 1 month
Differential Revision: https://reviews.freebsd.org/D35457

This revision is now accepted and ready to land.Jun 13 2022, 3:04 PM