Re: running into OOM killer with kexec loading large ramdisk
Hi, thanks for the explanation, I got it now working, with running the kexec call in the background and deleting the initramfs in the foreground after sleep 1. I still think kexec should handle this with less memory needed. greetings tpowa Am Fr., 25. März 2022 um 13:26 Uhr schrieb Philipp Rudo : > > Hi Tobias, > > On Wed, 23 Mar 2022 12:14:59 +0100 > Tobias Powalowski wrote: > > > Hi, > > again me, > > I try to load a 900MB ramdisk on a ramfs rootfs with kexec and a 10MB > > kernel. > > With 2800MB RAM assigned to qemu. > > Memory free by /proc/memstat: 2.2GB > > It keeps on OOM killed while executing: > > kexec -l kernel --initrd=initrd.img > > I can safely unpack the initrd in the ramfs without getting OOM killed. > > What is kexec doing wrong here? > > I don't think that kexec is doing anything wrong here. > > The kexec_load syscall is designed in a way that user space prepares > everything in a huge buffer and passes a pointer to it to the system > call. The systemcall then needs to copy everything from the user buffer > to a kernel buffer. So there are three copies of the initrd in memory > (including the one in ramfs). Together they take up 3 * 900MB = 2.7GB. > So basically all the memory of your guest. > > You can try using the kexec_file_load systemcall. That at least > eliminates the copy in the user buffer so there are only two copies > left. 400MB of free memory is still quite scarce, though. > > Thanks > Philipp > -- Tobias Powalowski Arch Linux Developer & Package Maintainer (tpowa) https://www.archlinux.org tp...@archlinux.org St. Martin-Apotheke Herzog-Georg-Str. 25 89415 Lauingen https://www.st-martin-apo.de i...@st-martin-apo.de ___ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec
running into OOM killer with kexec loading large ramdisk
Hi, again me, I try to load a 900MB ramdisk on a ramfs rootfs with kexec and a 10MB kernel. With 2800MB RAM assigned to qemu. Memory free by /proc/memstat: 2.2GB It keeps on OOM killed while executing: kexec -l kernel --initrd=initrd.img I can safely unpack the initrd in the ramfs without getting OOM killed. What is kexec doing wrong here? greetings tpowa -- Tobias Powalowski Arch Linux Developer & Package Maintainer (tpowa) https://www.archlinux.org tp...@archlinux.org St. Martin-Apotheke Herzog-Georg-Str. 25 89415 Lauingen https://www.st-martin-apo.de i...@st-martin-apo.de ___ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec
Re: Qemu does not like kexec initrd
Hi, after doing tests with initrds, it seems the error on kernel message is wrong, the ZSTD archive is fine and decompression is not faulty. For what's it worth for, the shown error is wrong. All works as expected. greetings tpowa Am Do., 17. März 2022 um 09:45 Uhr schrieb Tobias Powalowski : > > Hi, > Which upstream code? > Arch Linux kernel is upstream > Qemu is upstream > - Kernel message prints the error > greetings > tpowa > > Am Do., 17. März 2022 um 09:34 Uhr schrieb Tao Liu : > > > > Hi Tobias, > > > > The kernel you provided is not an upstream kernel, which contains > > distribution specific modification, as well as the kexec. Since you > > are reporting an issue to the upstream, I suggest you: > > > > 1) re-run your tests against the upstream code, instead of > > distribution specific code. > > 2) if the issue still persists, you can report the issue to upstream, > > as well as the detailed log information, such as: > > what is the log message? > > who prints the log message, qemu? kernel? kexec? > > what is the behaviour when the error occurs? kernel panic? error > > logs? qemu crash? > > For your case, Loading zstd initrd will cause an error(what error? who > > prints the error?) ZSTD-data is corrupt error on qemu(how do you know > > the data is corrupt? what attempts did you make?). > > > > Please note upstream is not responsible for the distribution specific > > issues. > > > > Thanks, > > Tao Liu > > > > > > On Wed, Mar 16, 2022 at 10:33 PM Tobias Powalowski > > wrote: > > > > > > Kernel and zstd initrds are located here: > > > https://pkgbuild.com/~tpowa/archboot-images/x86_64/latest/boot/ > > > kexec -l kernel --initrd=initrd --reuse-cmdline > > > systemctl kexec > > > > > > Am Mi., 16. März 2022 um 15:19 Uhr schrieb Tao Liu : > > > > > > > > Hi Tobias, > > > > > > > > On Wed, Mar 16, 2022 at 10:10 PM Tobias Powalowski > > > > wrote: > > > > > > > > > > Hi, > > > > > Do you need anything from my side? > > > > > Test files? > > > > > Test system is latest Arch Linux with qemu 6.2.0 > > > > > greetings > > > > > tpowa > > > > > > > > > > > > > Could you briefly introduce your test steps please? I will try to > > > > reproduce it. > > > > > > > > Thanks, > > > > Tao Liu > > > > > > > > > Am Mi., 16. März 2022 um 14:58 Uhr schrieb Tao Liu : > > > > > > > > > > > > Hi Baoquan, > > > > > > > > > > > > On Wed, Mar 16, 2022 at 7:38 PM Baoquan He wrote: > > > > > > > > > > > > > > Cc Tao, > > > > > > > > > > > > > > On 03/16/22 at 11:57am, Tobias Powalowski wrote: > > > > > > > > Hi > > > > > > > > I just discovered this: > > > > > > > > https://githubhot.com/repo/talos-systems/talos/issues/4947 > > > > > > > > I also suffer from this in my project: > > > > > > > > Loading zstd initrd will cause an error: > > > > > > > > ZSTD-data is corrupt error on qemu. > > > > > > > > Is there a fix or workaround for this issue? > > > > > > > > > > > > > > Hi Tao, > > > > > > > > > > > > > > Did you ever met this when you introduce zstd to kexec/kdump? > > > > > > > > > > > > > No, I haven't encountered this issue before. > > > > > > > > > > > > Thanks, > > > > > > Tao Liu > > > > > > > > > > > > > Thanks > > > > > > > Baoquan > > > > > > > > > > > > > > > > > > > > > > > -- > > > > > > > > Tobias Powalowski > > > > > > > > Arch Linux Developer & Package Maintainer (tpowa) > > > > > > > > https://www.archlinux.org > > > > > > > > tp...@archlinux.org > > > > > > > > > > > > > > > > St. Martin-Apotheke > > > > > > > > Herzog-Georg-Str. 25 > > > > > > > > 89415 Lauingen > > > > > > > > https://www.st-martin-apo.de > > >
Re: Qemu does not like kexec initrd
Hi, Which upstream code? Arch Linux kernel is upstream Qemu is upstream - Kernel message prints the error greetings tpowa Am Do., 17. März 2022 um 09:34 Uhr schrieb Tao Liu : > > Hi Tobias, > > The kernel you provided is not an upstream kernel, which contains > distribution specific modification, as well as the kexec. Since you > are reporting an issue to the upstream, I suggest you: > > 1) re-run your tests against the upstream code, instead of > distribution specific code. > 2) if the issue still persists, you can report the issue to upstream, > as well as the detailed log information, such as: > what is the log message? > who prints the log message, qemu? kernel? kexec? > what is the behaviour when the error occurs? kernel panic? error > logs? qemu crash? > For your case, Loading zstd initrd will cause an error(what error? who > prints the error?) ZSTD-data is corrupt error on qemu(how do you know > the data is corrupt? what attempts did you make?). > > Please note upstream is not responsible for the distribution specific issues. > > Thanks, > Tao Liu > > > On Wed, Mar 16, 2022 at 10:33 PM Tobias Powalowski > wrote: > > > > Kernel and zstd initrds are located here: > > https://pkgbuild.com/~tpowa/archboot-images/x86_64/latest/boot/ > > kexec -l kernel --initrd=initrd --reuse-cmdline > > systemctl kexec > > > > Am Mi., 16. März 2022 um 15:19 Uhr schrieb Tao Liu : > > > > > > Hi Tobias, > > > > > > On Wed, Mar 16, 2022 at 10:10 PM Tobias Powalowski > > > wrote: > > > > > > > > Hi, > > > > Do you need anything from my side? > > > > Test files? > > > > Test system is latest Arch Linux with qemu 6.2.0 > > > > greetings > > > > tpowa > > > > > > > > > > Could you briefly introduce your test steps please? I will try to > > > reproduce it. > > > > > > Thanks, > > > Tao Liu > > > > > > > Am Mi., 16. März 2022 um 14:58 Uhr schrieb Tao Liu : > > > > > > > > > > Hi Baoquan, > > > > > > > > > > On Wed, Mar 16, 2022 at 7:38 PM Baoquan He wrote: > > > > > > > > > > > > Cc Tao, > > > > > > > > > > > > On 03/16/22 at 11:57am, Tobias Powalowski wrote: > > > > > > > Hi > > > > > > > I just discovered this: > > > > > > > https://githubhot.com/repo/talos-systems/talos/issues/4947 > > > > > > > I also suffer from this in my project: > > > > > > > Loading zstd initrd will cause an error: > > > > > > > ZSTD-data is corrupt error on qemu. > > > > > > > Is there a fix or workaround for this issue? > > > > > > > > > > > > Hi Tao, > > > > > > > > > > > > Did you ever met this when you introduce zstd to kexec/kdump? > > > > > > > > > > > No, I haven't encountered this issue before. > > > > > > > > > > Thanks, > > > > > Tao Liu > > > > > > > > > > > Thanks > > > > > > Baoquan > > > > > > > > > > > > > > > > > > > > -- > > > > > > > Tobias Powalowski > > > > > > > Arch Linux Developer & Package Maintainer (tpowa) > > > > > > > https://www.archlinux.org > > > > > > > tp...@archlinux.org > > > > > > > > > > > > > > St. Martin-Apotheke > > > > > > > Herzog-Georg-Str. 25 > > > > > > > 89415 Lauingen > > > > > > > https://www.st-martin-apo.de > > > > > > > i...@st-martin-apo.de > > > > > > > > > > > > > > ___ > > > > > > > kexec mailing list > > > > > > > kexec@lists.infradead.org > > > > > > > http://lists.infradead.org/mailman/listinfo/kexec > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > -- > > > > Tobias Powalowski > > > > Arch Linux Developer & Package Maintainer (tpowa) > > > > https://www.archlinux.org > > > > tp...@archlinux.org > > > > > > > > St. Martin-Apotheke > > > > Herzog-Georg-Str. 25 > > > > 89415 Lauingen > > > > https://www.st-martin-apo.de > > > > i...@st-martin-apo.de > > > > > > > > > > > > > -- > > Tobias Powalowski > > Arch Linux Developer & Package Maintainer (tpowa) > > https://www.archlinux.org > > tp...@archlinux.org > > > > St. Martin-Apotheke > > Herzog-Georg-Str. 25 > > 89415 Lauingen > > https://www.st-martin-apo.de > > i...@st-martin-apo.de > > > -- Tobias Powalowski Arch Linux Developer & Package Maintainer (tpowa) https://www.archlinux.org tp...@archlinux.org St. Martin-Apotheke Herzog-Georg-Str. 25 89415 Lauingen https://www.st-martin-apo.de i...@st-martin-apo.de ___ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec
Re: Qemu does not like kexec initrd
Hi, Do you need anything from my side? Test files? Test system is latest Arch Linux with qemu 6.2.0 greetings tpowa Am Mi., 16. März 2022 um 14:58 Uhr schrieb Tao Liu : > > Hi Baoquan, > > On Wed, Mar 16, 2022 at 7:38 PM Baoquan He wrote: > > > > Cc Tao, > > > > On 03/16/22 at 11:57am, Tobias Powalowski wrote: > > > Hi > > > I just discovered this: > > > https://githubhot.com/repo/talos-systems/talos/issues/4947 > > > I also suffer from this in my project: > > > Loading zstd initrd will cause an error: > > > ZSTD-data is corrupt error on qemu. > > > Is there a fix or workaround for this issue? > > > > Hi Tao, > > > > Did you ever met this when you introduce zstd to kexec/kdump? > > > No, I haven't encountered this issue before. > > Thanks, > Tao Liu > > > Thanks > > Baoquan > > > > > > > > -- > > > Tobias Powalowski > > > Arch Linux Developer & Package Maintainer (tpowa) > > > https://www.archlinux.org > > > tp...@archlinux.org > > > > > > St. Martin-Apotheke > > > Herzog-Georg-Str. 25 > > > 89415 Lauingen > > > https://www.st-martin-apo.de > > > i...@st-martin-apo.de > > > > > > ___ > > > kexec mailing list > > > kexec@lists.infradead.org > > > http://lists.infradead.org/mailman/listinfo/kexec > > > > > > -- Tobias Powalowski Arch Linux Developer & Package Maintainer (tpowa) https://www.archlinux.org tp...@archlinux.org St. Martin-Apotheke Herzog-Georg-Str. 25 89415 Lauingen https://www.st-martin-apo.de i...@st-martin-apo.de ___ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec
Re: Qemu does not like kexec initrd
Hi, here the result of my tests with qemu: zstd is broken xz --check=crc32 is broken lz4 -l works gzip works Is there a bugtracker to report this or only this ML? Thanks for your help. greetings tpowa Am Mi., 16. März 2022 um 12:38 Uhr schrieb Baoquan He : > > Cc Tao, > > On 03/16/22 at 11:57am, Tobias Powalowski wrote: > > Hi > > I just discovered this: > > https://githubhot.com/repo/talos-systems/talos/issues/4947 > > I also suffer from this in my project: > > Loading zstd initrd will cause an error: > > ZSTD-data is corrupt error on qemu. > > Is there a fix or workaround for this issue? > > Hi Tao, > > Did you ever met this when you introduce zstd to kexec/kdump? > > Thanks > Baoquan > > > > > -- > > Tobias Powalowski > > Arch Linux Developer & Package Maintainer (tpowa) > > https://www.archlinux.org > > tp...@archlinux.org > > > > St. Martin-Apotheke > > Herzog-Georg-Str. 25 > > 89415 Lauingen > > https://www.st-martin-apo.de > > i...@st-martin-apo.de > > > > _______ > > kexec mailing list > > kexec@lists.infradead.org > > http://lists.infradead.org/mailman/listinfo/kexec > > > -- Tobias Powalowski Arch Linux Developer & Package Maintainer (tpowa) https://www.archlinux.org tp...@archlinux.org St. Martin-Apotheke Herzog-Georg-Str. 25 89415 Lauingen https://www.st-martin-apo.de i...@st-martin-apo.de ___ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec
Re: Qemu does not like kexec initrd
Hi, lzma is also affected, gzip works. Will test now xz. greetings tpowa Am Mi., 16. März 2022 um 12:38 Uhr schrieb Baoquan He : > > Cc Tao, > > On 03/16/22 at 11:57am, Tobias Powalowski wrote: > > Hi > > I just discovered this: > > https://githubhot.com/repo/talos-systems/talos/issues/4947 > > I also suffer from this in my project: > > Loading zstd initrd will cause an error: > > ZSTD-data is corrupt error on qemu. > > Is there a fix or workaround for this issue? > > Hi Tao, > > Did you ever met this when you introduce zstd to kexec/kdump? > > Thanks > Baoquan > > > > > -- > > Tobias Powalowski > > Arch Linux Developer & Package Maintainer (tpowa) > > https://www.archlinux.org > > tp...@archlinux.org > > > > St. Martin-Apotheke > > Herzog-Georg-Str. 25 > > 89415 Lauingen > > https://www.st-martin-apo.de > > i...@st-martin-apo.de > > > > _______ > > kexec mailing list > > kexec@lists.infradead.org > > http://lists.infradead.org/mailman/listinfo/kexec > > > -- Tobias Powalowski Arch Linux Developer & Package Maintainer (tpowa) https://www.archlinux.org tp...@archlinux.org St. Martin-Apotheke Herzog-Georg-Str. 25 89415 Lauingen https://www.st-martin-apo.de i...@st-martin-apo.de ___ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec
Qemu does not like kexec initrd
Hi I just discovered this: https://githubhot.com/repo/talos-systems/talos/issues/4947 I also suffer from this in my project: Loading zstd initrd will cause an error: ZSTD-data is corrupt error on qemu. Is there a fix or workaround for this issue? greetings tpowa -- Tobias Powalowski Arch Linux Developer & Package Maintainer (tpowa) https://www.archlinux.org tp...@archlinux.org St. Martin-Apotheke Herzog-Georg-Str. 25 89415 Lauingen https://www.st-martin-apo.de i...@st-martin-apo.de ___ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec
Re: Is it possible to use a stream for initrd=
Hi, thanks for your answers, would be really cool if someone could implement it. Would help my Arch Linux project to save even more RAM. https://wiki.archlinux.org/title/Archboot greetings tpowa Am Di., 15. Feb. 2022 um 11:27 Uhr schrieb Philipp Rudo : > > Hi Tobias, > > On Wed, 9 Feb 2022 10:32:24 +0100 > Tobias Powalowski wrote: > > > Sorry you misunderstood, I don't want to create the initrd.img file. > > I want to pass the zstd directly to kexec initrd= option. > > sorry, that is not possible. The kexec-tools expect a file name with > --initrd. Simply passing a binary blob to be used as initrd isn't > implemented. > > Thanks > Philipp > > > greetings > > tpowa > > > > Am Mi., 9. Feb. 2022 um 10:28 Uhr schrieb Baoquan He : > > > > > > On 02/09/22 at 10:16am, Tobias Powalowski wrote: > > > > Hi, > > > > I have a tmp directory with all files placed in: > > > > find . -mindepth 1 -printf '%P\0' | sort -z | LANG=C bsdtar --uid 0 > > > > --gid 0 --null -cnf - -T - |\ > > > > LANG=C bsdtar --null -cf - --format=newc @- | zstd -T0 > /initrd.img > > > > > > > > and this initrd.img I want to write into kexec without creating the > > > > initrd file. > > > > > > > > kexec -l /vmlinuz-linux --initrd=/initrd.img --reuse-cmdline > > > > systemctl kexec > > > > > > See manpage of kexec, the EXAMPLE part: > > > > > > kexec -l /boot/vmlinux --initrd=/boot/initrd --reuse-cmdline > > > kexec -e > > > > > > > > -- Tobias Powalowski Archlinux Developer & Package Maintainer (tpowa) https://www.archlinux.org tp...@archlinux.org St. Martin-Apotheke Herzog-Georg-Str. 25 89415 Lauingen https://www.st-martin-apo.de i...@st-martin-apo.de ___ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec
Re: Is it possible to use a stream for initrd=
Sorry you misunderstood, I don't want to create the initrd.img file. I want to pass the zstd directly to kexec initrd= option. greetings tpowa Am Mi., 9. Feb. 2022 um 10:28 Uhr schrieb Baoquan He : > > On 02/09/22 at 10:16am, Tobias Powalowski wrote: > > Hi, > > I have a tmp directory with all files placed in: > > find . -mindepth 1 -printf '%P\0' | sort -z | LANG=C bsdtar --uid 0 > > --gid 0 --null -cnf - -T - |\ > > LANG=C bsdtar --null -cf - --format=newc @- | zstd -T0 > /initrd.img > > > > and this initrd.img I want to write into kexec without creating the initrd > > file. > > > > kexec -l /vmlinuz-linux --initrd=/initrd.img --reuse-cmdline > > systemctl kexec > > See manpage of kexec, the EXAMPLE part: > > kexec -l /boot/vmlinux --initrd=/boot/initrd --reuse-cmdline > kexec -e > -- Tobias Powalowski Archlinux Developer & Package Maintainer (tpowa) https://www.archlinux.org tp...@archlinux.org St. Martin-Apotheke Herzog-Georg-Str. 25 89415 Lauingen https://www.st-martin-apo.de i...@st-martin-apo.de ___ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec
Re: Is it possible to use a stream for initrd=
Hi, I have a tmp directory with all files placed in: find . -mindepth 1 -printf '%P\0' | sort -z | LANG=C bsdtar --uid 0 --gid 0 --null -cnf - -T - |\ LANG=C bsdtar --null -cf - --format=newc @- | zstd -T0 > /initrd.img and this initrd.img I want to write into kexec without creating the initrd file. kexec -l /vmlinuz-linux --initrd=/initrd.img --reuse-cmdline systemctl kexec Thanks for your help. greetings tpowa Am Mi., 9. Feb. 2022 um 04:22 Uhr schrieb Baoquan He : > > On 02/08/22 at 04:36pm, Tobias Powalowski wrote: > > Hi, > > just a quick question, is it possible to use a stream for initrd= parameter? > > I want to save RAM/Space and directly load the ramdisk into memory for > > reboot. > > initrd=< ... does not work. > > Are you using kexec -l or kexec -p to reboot? Can you write down your > operation steps? > -- Tobias Powalowski Archlinux Developer & Package Maintainer (tpowa) https://www.archlinux.org tp...@archlinux.org St. Martin-Apotheke Herzog-Georg-Str. 25 89415 Lauingen https://www.st-martin-apo.de i...@st-martin-apo.de ___ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec
Is it possible to use a stream for initrd=
Hi, just a quick question, is it possible to use a stream for initrd= parameter? I want to save RAM/Space and directly load the ramdisk into memory for reboot. initrd=< ... does not work. Thanks. greetings tpowa -- Tobias Powalowski Archlinux Developer & Package Maintainer (tpowa) https://www.archlinux.org tp...@archlinux.org St. Martin-Apotheke Herzog-Georg-Str. 25 89415 Lauingen https://www.st-martin-apo.de i...@st-martin-apo.de ___ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec