2023-09-07 17:19:52

by Tony Lindgren

[permalink] [raw]
Subject: Re: Linux 6.5 speed regression, boot VERY slow with anything systemd related

* Marc Haber <[email protected]> [230907 10:14]:
> The most basic reproducer I found is:
>
> /usr/bin/qemu-system-x86_64 \
> -m 768 \
> -machine pc-i440fx-2.1,accel=kvm,usb=off,dump-guest-core=off \
> -nodefaults \
> -drive file=/dev/prom/lasso2,format=raw,if=none,id=drive-virtio-disk0,cache=none,discard=unmap,aio=native \
> -device virtio-blk-pci,scsi=off,bus=pci.0,addr=0x3,drive=drive-virtio-disk0,id=virtio-disk0,bootindex=1,write-cache=on \
> -serial stdio

So I tried something similar with just kernel and ramdisk:

qemu-system-x86_64 \
-m 768 \
-machine pc-i440fx-2.1,accel=kvm,usb=off,dump-guest-core=off \
-nodefaults \
-kernel ~/bzImage \
-initrd ~/ramdisk.img \
-serial stdio \
-append "console=ttyS0 debug"

It boots just fine for me. Console seems to come up a bit faster if I
leave out the machine option. I tried this with qemu 8.0.3 on a m1 laptop
running linux in case the machine running the qemu host might make some
difference..

On dmesg I see 8250 come up:

[ 0.671877] Serial: 8250/16550 driver, 4 ports, IRQ sharing enabled
[ 0.680185] 00:03: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A

> Simplifying the drive and device virtio-blk-pci lines prevents the
> initramfs of the VM from finding the disk and thus the system doesn't
> get as far to show the issue.
>
> If you want to see it work, add
> -device qxl-vga,id=video0,ram_size=67108864,vram_size=67108864,vram64_size_mb=0,vgamem_mb=16,max_outputs=1,bus=pci.0,addr=0x2 \
> -vnc :1
> point a vncviewer to port 5901, remove the "serial=ttyS0" configuration
> and see the system run normally.
>
> What else can I do?

Still a minimal reproducable test case is needed.. Or do you have the
dmesg output of the failing boot?

Regards,

Tony


2023-09-10 05:40:35

by Marc Haber

[permalink] [raw]
Subject: Re: Linux 6.5 speed regression, boot VERY slow with anything systemd related

On Thu, Sep 07, 2023 at 01:51:50PM +0300, Tony Lindgren wrote:
> Still a minimal reproducable test case is needed.. Or do you have the
> dmesg output of the failing boot?

I have both dmesg output of a failing boot (with my kernel) and of a
successful boot (with the Debian kernel). Attached.


In the last few days I have made some additional experiments. Since 6.5
has landed in Debian experimental in the mean time, I tried with the
Debian kernel: It works. I then used the Debian .config with my kernel
tree and my build environment, it works as well. I tried again with my
own .config, doesn't work.

I spent the next days with kind of binary searching the .config
differences between mine and Debian's (they're huge), and I now have two
configurations that only differ in CONFIG_PREEMPT_VOLUNTARY and
CONFIG_PREMPT. The version with CONFIG_PREEMPT_VOLUNTARY seems to work
(both attached). Sadly, my "own" .config uses CONFIG_PREEMPT_VOLUNTARY
and doesn't work, so the actual problem seems to be a bit more complex
still.

Greetings
Marc

--
-----------------------------------------------------------------------------
Marc Haber | "I don't trust Computers. They | Mailadresse im Header
Leimen, Germany | lose things." Winona Ryder | Fon: *49 6224 1600402
Nordisch by Nature | How to make an American Quilt | Fax: *49 6224 1600421


Attachments:
(No filename) (1.35 kB)
dmesg-debiankernel (40.93 kB)
dmesg-zgkernel (33.89 kB)
8-works (166.65 kB)
9-doesntwork (166.65 kB)
Download all attachments