Now, that memory is not zeroed, page_is_buddy() can return true after kexec
when memory is dirty (unfortunately memset(1) with CONFIG_VM_DEBUG does not
catch this case). And proceed further to incorrectly remove buddy from the
list.
OK, I thought this was a regression from one of the recent patches. So
the problem is not new. Why don't we see the same problem during the
standard boot?
Because, I believe, BIOS is zeroing all the memory for us.
I thought you were runnning with the debugging which poisons all the
allocated memory...
This is why we must initialize the computed buddy page beforehand.
Ble, this is really ugly. I will think about it more.
Another approach that I considered is to split loop inside
deferred_init_range() into two loops: one where we initialize pages by
calling __init_single_page(), another where we free them to buddy allocator
by calling deferred_free_range().
Yes, that would make much more sense to me.