Page MenuHomeFreeBSD

Reduce wpa_supplicant sleep
ClosedPublic

Authored by cy on Jun 12 2022, 2:56 PM.
Tags
None
Referenced Files
Unknown Object (File)
Apr 5 2024, 7:40 PM
Unknown Object (File)
Feb 2 2024, 3:04 AM
Unknown Object (File)
Jan 11 2024, 4:51 PM
Unknown Object (File)
Dec 24 2023, 8:25 AM
Unknown Object (File)
Dec 20 2023, 6:18 AM
Unknown Object (File)
Dec 11 2023, 5:25 AM
Unknown Object (File)
Dec 8 2023, 9:22 AM
Unknown Object (File)
Nov 25 2023, 8:26 PM
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