Hi @jock
According to the following warning from dmesg.log, it seems the first version of the fix @hexdump posted was used -- unfortunately it's also buggy (sorry)...
[ 1235.795803] ------------[ cut here ]------------
[ 1235.795827] WARNING: CPU: 2 PID: 55 at mm/vmscan.c:4464 lru_gen_look_around+0x3fc/0x728
I do have the latest MGLRU backported to v5.18, and you can apply it by
git fetch https://linux-mm.googlesource.com/page-reclaim refs/changes/17/1617/2 && git cherry-pick FETCH_HEAD~14..FETCH_HEAD
I'm also trying to attach the patch file here but it seems I'm too new to be allowed to attach files. Please feel free to send me an email if you need the patch file or anything else.
From kernel_panic.log, it seems the bad thing already happened before
root@rk3318-box:~# [ 9596.639183] BUG: Bad page state in process kswapd0 pfn:1d8b6
[ 9596.640943] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000a60
Usually the Bad page state warning appears when there is a double-free or free-after-use memory corruption. It'd be helpful if there is a way to grab the log preceding this error.
Alternatively, if we can't fix the v5.18 baseline kernel, I can further backport MGLRU to v5.17.