All of lore.kernel.org
 help / color / mirror / Atom feed
* Why do kernel panics caused by init exiting peg the CPU?
@ 2021-06-16 10:22 Andrei E.
  0 siblings, 0 replies; only message in thread
From: Andrei E. @ 2021-06-16 10:22 UTC (permalink / raw)
  To: linux-kernel

Good morning LKML,

I have noticed that using a very simple hello world program as init (very similar to the one from https://landley.net/writing/rootfs-howto.html, just with the sleep function removed) pegs the CPU on both linux (5.12.10.arch1-1) and linux-lts (5.10.43-1) kernels on Arch. Is this intended?

Steps to reproduce:
#!/bin/sh
cat << END > hello.c
#include <stdio.h>

int main(int argc, char *argv[])
{
  printf("Hello world\n");
}
END

gcc -static hello.c -o hello

mkdir sub
cp hello sub/init
cd sub
find . | cpio -o -H newc | gzip > ../initramfs_data.cpio.gz
cd ..
rm -rf sub

qemu-system-x86_64 -kernel /boot/vmlinuz-linux-lts -initrd initramfs_data.cpio.gz
# Spikes one thread to 100% usage. Causes the same issue with vmlinuz-linux.

Thank you for your time,
Andrei E.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-06-16 10:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-16 10:22 Why do kernel panics caused by init exiting peg the CPU? Andrei E.

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.