Bug 243249

Summary: FreeBSD 12.1 ThinkPad X201 20 second delay during resume
Product: Base System Reporter: Jason W. Bacon <jwb>
Component: kernAssignee: freebsd-bugs mailing list <bugs>
Status: New ---    
Severity: Affects Only Me CC: emaste
Priority: --- Keywords: regression
Version: 12.1-RELEASE   
Hardware: amd64   
OS: Any   

Description Jason W. Bacon freebsd_committer 2020-01-10 16:11:36 UTC
A nuisance issue that appeared in 12.0 and continues in 12.1.

Suspend/resume basically works fine, but the system hangs for 20 seconds between 

iwn0: iwn_read_firmware: ucode rev=0x09dd0401

and

uhub0: <Intel EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus0

Running 11.x, resume was very quick.

I'm not too concerned about it, but maybe investigating this issue will uncover solutions for more serious problems.  One more data point...
Comment 1 Ed Maste freebsd_committer 2020-01-10 18:52:27 UTC
Is there any chance you can bisect between the fast and slow versions?
Comment 2 Jason W. Bacon freebsd_committer 2020-01-11 16:23:50 UTC
(In reply to Ed Maste from comment #1)

Yes, but not real soon.  I have to finish up some projects, after which I can try an 11.3 install on a spare disk.

For now I'll add that I don't see this behavior on a ThinkPad T61 (which also uses iwn) or ThinkPad X120e (rtwn).
Comment 3 Jason W. Bacon freebsd_committer 2020-01-26 16:01:37 UTC
I should have an 11.3 install running shortly.

What specific info should I provide?
Comment 4 Jason W. Bacon freebsd_committer 2020-02-09 15:57:27 UTC
Homed in on the issue by disabling all non-essential modules in /boot/loader.conf and services /etc/rc.conf, which alleviated the issue, then restoring them one by one.

The delay appears to be tied to kernel frequency.

I had set kern.hz=100 in loader.conf to extend battery life.  I've been doing this on laptops and it has never had a negative impact, until I upgraded to 12.x on the ThinkPad X201.

After removing this and restoring all other modules and servies, the delay is about 2 seconds rather than 20.  So increasing the kernel frequency by a factor of 10 (default is 1000) reduces the delay by a factor of 10.