Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] Slow boot and WIFI issue after kernel upgrade
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
Stopi
n00b
n00b


Joined: 28 Jul 2016
Posts: 20
Location: Laos

PostPosted: Sat Jul 03, 2021 5:13 pm    Post subject: [Solved] Slow boot and WIFI issue after kernel upgrade Reply with quote

Hi,

I've been running this computer since 6+ years now and the last kernel upgrade introduce annoying issues.
I just upgraded from gentoo-sources 5.4.80-r1 to 5.10.27, using
Code:
make oldconfig
as I usually do.
At least 2 big problems raised.

First of all the system takes 1min more to start, from EFI to Plasma login.
I have 3 hard drives: 1 nvme 256Gb for root (XFS) and 2x SATA-2Tb on softraid for /home (ReiserFS).
Those are LVM + LUKS partitions, except for /boot which is primary ext2 on 1st nvme disk.

Here is the dmesg from old 5.4.80-r1: https://dpaste.com/EVUH6RLLV#

And here's the one from new 5.10.27: https://dpaste.com/7M934YE7M

So you see, a lot slower, with one minute lost in a mysterious black hole after 4 seconds...

But that's not all, there's also a second more annoying issue, related to the WIFI.
While I can still connect to my provider's router (slow fiber), I cannot connect anymore to my Android hotspot (fast 4G).
And there's no change whatsoever in dmesg, both produce same output:
Code:
# dmesg -w
(...)
[ 1143.931701] R8188EU: assoc success
[ 1143.971554] IPv6: ADDRCONF(NETDEV_CHANGE): wlp0s20u8: link becomes ready

Actually I couldn't even find any usefull log at all, I tried with
Code:
xtail /var/log
without any result.

I've tried to temporarily disable IPv6 but that didn't help.
Code:
echo 1 > /proc/sys/net/ipv6/conf/wlp0s20u8/disable_ipv6


I have no clue of wha'ts going on here.
All I know is I've upgraded my whole system, so old kernel was built with GCC 9 when the new one was built with GCC 10, including the initramfs (except for cryptsetup which failed to emerge at first but now it's fixed and that didn't change anything).
Anyway, when booting back with the old kernel everything run smoothly, system starts fast and NetworkManager can connect to Android hotspot without changing any configuration.

Knowing this, I made a currated diff of both kernel configs, ("<" for old and ">" for new): https://dpaste.com/88FBPE9YU

Please help!


Last edited by Stopi on Sat Jul 10, 2021 6:57 pm; edited 1 time in total
Back to top
View user's profile Send private message
Stopi
n00b
n00b


Joined: 28 Jul 2016
Posts: 20
Location: Laos

PostPosted: Fri Jul 09, 2021 7:47 pm    Post subject: Still no clue Reply with quote

Hi there!
Sooo, apparently I'm not the only one confused by this madness.

Anyway, despite a very busy week, I've managed to put few hours here and there in the problem.
I decided to reset the config, so instead of
Code:
make oldconfig
I started with
Code:
make deconfig
make menuconfig

And from this default config I've carefully checked all the boxes for my requirements.
In the end even with that fresh kernel (I've done this many times over last decades, its not my first kernel config) I end up having the same problems.
I'm still puzzled...

I mean, the driver for that WIFI card is in the "staging" section so maybe the issue is to expect, even if it perfectly worked for years.
But regarding the mysterious 50/60 seconds pause at the very beginning, I have no idea.
Previously I had to wait at that point but since it was less that 10 seconds, I was never really concerned.
Maybe decrypting the LUKS partition just takes looooooong... I need to check that.

I'll try to find some time in the weekend to investigate more.
I'll keep you posted.
Back to top
View user's profile Send private message
Stopi
n00b
n00b


Joined: 28 Jul 2016
Posts: 20
Location: Laos

PostPosted: Sat Jul 10, 2021 6:56 pm    Post subject: Solved Reply with quote

Hi good people,

so as suspected the problem came from cryptsetup.
I've played with my custom initramfs and it appears the "black hole" was indeed the moment when my root partition was decrypted from LUKS.

Since a while, every time I emerged cryptsetup the ebuild was warning me:
Code:
WARN: configure
Note that kernel backend is very slow for this type of operation
and is provided mainly for embedded systems wanting to avoid
userspace crypto libraries.


But since I had the static use flag on, I thought I was covered.
That was just me not understanding what I was doing here...
There are other USE that can be set for sys-fs/cryptsetup:
Code:
 - - gcrypt      : Use dev-libs/libgcrypt crypto backend
 + + kernel      : Use kernel crypto backend (mainly for embedded systems)
 - - nettle      : Use dev-libs/nettle crypto backend
 - - openssl     : Use dev-libs/openssl crypto backend


So I've ran a bunch of benchmarks, here are some extract from dmesg:
Code:
## kernel 5.4.80-r1
[    3.905952] sd 4:0:0:0: [sdc] Attached SCSI disk
[   11.702708] cryptsetup (146) used greatest stack depth: 13704 bytes left
[   11.706041] XFS (dm-0): Mounting V5 Filesystem
[   11.735869] XFS (dm-0): Ending clean mount
[   11.739419] xfs filesystem being mounted at /mnt/root supports timestamps until 2038 (0x7fffffff)

## kernel 5.10.27
[    4.072914] sd 4:0:0:0: [sdc] Attached SCSI disk
[   59.352814] cryptsetup (148) used greatest stack depth: 14024 bytes left
[   59.362474] XFS (dm-0): Mounting V5 Filesystem
[   59.458340] XFS (dm-0): Ending clean mount
[   59.467919] xfs filesystem being mounted at /mnt/root supports timestamps until 2038 (0x7fffffff)

## openssl
[    1.776430] hid-generic 0003:093A:2510.0003: input,hidraw2: USB HID v1.11 Mouse [PixArt USB Optical Mouse] on usb-0000:00:14.0-14/input0
[   15.708942] random: fast init done
[   15.719492] XFS (dm-0): Mounting V5 Filesystem
[   15.746887] XFS (dm-0): Ending clean mount
[   15.753756] xfs filesystem being mounted at /mnt/root supports timestamps until 2038 (0x7fffffff)

## nettle
[    1.767253] hid-generic 0003:093A:2510.0003: input,hidraw2: USB HID v1.11 Mouse [PixArt USB Optical Mouse] on usb-0000:00:14.0-14/input0
[   17.056573] XFS (dm-0): Mounting V5 Filesystem
[   17.119245] XFS (dm-0): Starting recovery (logdev: internal)
[   17.140383] XFS (dm-0): Ending recovery (logdev: internal)
[   17.146268] xfs filesystem being mounted at /mnt/root supports timestamps until 2038 (0x7fffffff)

## libgcrypt cannot be used with USE="static"


As you can see, unlike what the ebuild said, the kernel backend was faster until last kernel version.
I'm now switching to openssl backend for cryptsetup:
Code:
sys-fs/cryptsetup -kernel -gcrypt -nettle openssl static
dev-libs/openssl static-libs

This solves my slow boot issue.

---

For the WIFI issue, I guess since the driver is still in kernel's "staging drivers" section (CONFIG_STAGING), I'm screwed.
That's a shame because that driver used to work since many months (maybe 1 or 2 years, can't remember).
Anyway, I can just spend $10 and get a Linux friendly USB wireless card so not a big deal.

I'm sorry for the noise, who knows it might help others...
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum