kho: handle failures to reserve preserved memory
Get series with b4
b4 am [email protected]Versions newest first
- v2 Latest2 patches 3 repliesIn review
Changes in v2 from the cover letter
- Drop the handover and carry on instead of panicking, with reserve_mem_kho_revive() reserving its own region (Mike)
- Stop kho_init() from releasing inherited bootmem areas after a failed retrieval, as a separate patch (Mike)
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | kho: skip bootmem setup in kho_init() if bootmem was inheritedkernel/ | +8 | 1 reply | |
| 2/2 | kho: drop the handover if preserved memory can't be reservedkernel/ mm/ | +23 | 1 reply |
Reviews trailers per patch
1 of 2 patches has a Reviewed-by or Acked-by.
| Patch | Pratyush Yadav |
|---|---|
| 1/2 | |
| 2/2 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v2 0/2] kho: handle failures to reserve preserved memory
When a kernel boots with a handover, kho_preserved_memory_reserve() reserves each range of preserved memory in memblock, but it ignores failures. If one happens, memory that a KHO user still expects to restore can be released to the page allocator. This needs memblock to fail to grow its reserved array, so it's unlikely. But if it does happen, the result is bad enough to be worth handling.
Patch 2 makes the walk stop on such a failure, so that kho_mem_retrieve() drops the handover and the boot carries on without it. For that to be safe, reserve_mem_kho_revive() now reserves its own region, and patch 1 stops kho_init() from releasing inherited bootmem areas after a failed retrieval.
From a quick check I did with one of the reservations forced to fail, the kernel logs the failure and boots without the handover. The reserve_mem region stays reserved, and a later KHO kexec out of that kernel works.
v2:
- Drop the handover and carry on instead of panicking, with reserve_mem_kho_revive() reserving its own region (Mike)
- Stop kho_init() from releasing inherited bootmem areas after a failed retrieval, as a separate patch (Mike)
v1: https://lore.kernel.org/r/[email protected]
Chris Down (2):
kho: skip bootmem setup in kho_init() if bootmem was inherited
kho: drop the handover if preserved memory can't be reserved
kernel/liveupdate/kho_core.c | 28 +++++++++++++++++++++++----- mm/memblock.c | 8 ++++++++ 2 files changed, 31 insertions(+), 5 deletions(-)
base-commit: ec459d99ed222228b3d601818fd1e24822a450d6
Signature · 1 line
2.56.1