mirror-linux/kernel/liveupdate
Pratyush Yadav (Google) 8fd2f26fa2 kho: fix order calculation for kho_unpreserve_pages()
Commit 91e74fa8b1 ("kho: make sure preservations do not span multiple
NUMA nodes") made sure preservations from kho_preserve_pages() do not
span multiple NUMA nodes. If they do, the order is reduced and tried
again.

The same logic was not implemented for kho_unpreserve_pages(). This can
result in unpreserve calculating a different order than preserve, and
thus not actually unpreserving the pages.

Fix this by moving the order calculation logic to
__kho_preserve_pages_order() and use it from both preserve and
unpreserve paths.

Move __kho_unpreserve() down to avoid having a forward declaration. Its
users are further down in the file anyway. Also, it results in grouping
for all the page-level preservation and unpreservation functions. This
unfortunately makes the diff hard to read, but the main change in
__kho_unpreserve() is to call __kho_preserve_pages_order() instead of
open-coding the order calculation.

Fixes: 91e74fa8b1 ("kho: make sure preservations do not span multiple NUMA nodes")
Cc: stable@vger.kernel.org
Signed-off-by: Pratyush Yadav (Google) <pratyush@kernel.org>
Reviewed-by: Samiullah Khawaja <skhawaja@google.com>
Reviewed-by: Pasha Tatashin <pasha.tatashin@soleen.com>
Link: https://patch.msgid.link/20260519133332.2498092-1-pratyush@kernel.org
Signed-off-by: Mike Rapoport (Microsoft) <rppt@kernel.org>
2026-05-26 11:01:49 +03:00
..
Kconfig liveupdate: separate memfd support into LIVEUPDATE_MEMFD 2026-01-26 19:07:10 -08:00
Makefile liveupdate: luo_flb: introduce File-Lifecycle-Bound global state 2026-02-08 00:13:33 -08:00
kexec_handover.c kho: fix order calculation for kho_unpreserve_pages() 2026-05-26 11:01:49 +03:00
kexec_handover_debug.c
kexec_handover_debugfs.c kho: fix kho_in_debugfs_init() to handle non-FDT blobs 2026-04-18 00:10:48 -07:00
kexec_handover_internal.h kho: rename fdt parameter to blob in kho_add/remove_subtree() 2026-04-18 00:10:48 -07:00
luo_core.c liveupdate: protect file handler list with rwsem 2026-04-18 00:10:49 -07:00
luo_file.c liveupdate: defer file handler module refcounting to active sessions 2026-04-18 00:10:50 -07:00
luo_flb.c liveupdate: make unregister functions return void 2026-04-18 00:10:50 -07:00
luo_internal.h liveupdate: remove liveupdate_test_unregister() 2026-04-18 00:10:50 -07:00
luo_session.c liveupdate: fix return value on session allocation failure 2026-04-27 05:54:23 -07:00