Disabling disk swap is enough. PF are still enabled when using zram as swap and the problem has never happened with that enabled, so the problem is related to disk swap on the host but can't really point my finger to a specific component (kernel, QEMU, etc).
For me is a fix in the sense that it works without panics for months and I prefer that to having any amount of extra ram available, although I would really like to see this fixed sooner than later.
We kinda know why the problem happens, more or less...
if the VM tries to access a memory zone that the host has currently swapped a PF will be generated so that the guest kernel can do something else on that vCPU while waiting, this behavior is normal.
There are two mechanism by which the host can talk this PF to the guest kernel
- the older one implemented with the
kvm-asyncpf qemu flag, that uses cpu exceptions for both "Page Not Present" and "Page Ready" signaling
if that "Page Ready" exception is send while the guest kernel cannot handle it, that guest kernel will panic
- the newer 5.10+, implemented with the
kvm-asyncpf-int qemu flag, this one uses the normal exception for the PF, but handles the "Page Ready" signal through an async interruption, which can wait till the kernel can process it.
the panics on the guest PVE kernel seem to happen cause the exceptions, be it the Page nor Found or the Page Ready are being sent while the kernel is doing kernel level stuff that cannot be disrupted.
The thing is in not sure how to disable
kvm-asyncpf while keeping
kvm-asyncpf-int or if that is possible at all.
In case that the panics are happening because of the "Page Not Present" exceptions, then not much can be done other than either disabling the whole PF mechanism or disabling swap, each with its own implications,
if swap is disabled, we have to deal with no swap, which is non-ideal
if the PF mechanism is disabled then the vCPU threads will freeze for some milliseconds till the memory is brought back to ram and they are thawed by qemu/kvm, which can also be non-ideal for certain workflows.
I'm not sure if just using zram for swap exhibits a different behavior than a disk based one.
So it may just be that either the kernel handles swapping in the pages differently or that with a smaller size swap the PF are statistically more rare.
So we are put in a "choose your poison" situation.