mirror of
https://github.com/torvalds/linux.git
synced 2026-12-04 04:14:24 +00:00
KHO allows clients to preserve memory regions at any point before the KHO state is finalized. The finalization process itself involves KHO performing its own actions, such as serializing the overall preserved memory map. If this finalization process is aborted, the current implementation destroys KHO's internal memory tracking structures (`kho_out.ser.track.orders`). This behavior effectively unpreserves all memory from KHO's perspective, regardless of whether those preservations were made by clients before the finalization attempt or by KHO itself during finalization. This premature unpreservation is incorrect. An abort of the finalization process should only undo actions taken by KHO as part of that specific finalization attempt. Individual memory regions preserved by clients prior to finalization should remain preserved, as their lifecycle is managed by the clients themselves. These clients might still need to call kho_unpreserve_folio() or kho_unpreserve_phys() based on their own logic, even after a KHO finalization attempt is aborted. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Pasha Tatashin <[email protected]> Reviewed-by: Pratyush Yadav <[email protected]> Cc: Alexander Graf <[email protected]> Cc: Changyuan Lyu <[email protected]> Cc: Christian Brauner <[email protected]> Cc: Jason Gunthorpe <[email protected]> Cc: Jason Gunthorpe <[email protected]> Cc: Jonathan Corbet <[email protected]> Cc: Masahiro Yamada <[email protected]> Cc: Miguel Ojeda <[email protected]> Cc: "Mike Rapoport (Microsoft)" <[email protected]> Cc: Randy Dunlap <[email protected]> Cc: Simon Horman <[email protected]> Cc: Tejun Heo <[email protected]> Cc: Zhu Yanjun <[email protected]> Signed-off-by: Andrew Morton <[email protected]>