Re: [RFC v2 05/16] luo: luo_core: integrate with KHO
From: Mike Rapoport
Date: Mon Jun 23 2025 - 03:33:51 EST
On Wed, Jun 18, 2025 at 01:43:18PM -0400, Pasha Tatashin wrote:
> On Wed, Jun 18, 2025 at 1:00 PM Pasha Tatashin
>
> So currently, KHO provides the following two types of internal API:
>
> Preserve memory and metadata
> =========================
> kho_preserve_folio() / kho_preserve_phys()
> kho_unpreserve_folio() / kho_unpreserve_phys()
> kho_restore_folio()
>
> kho_add_subtree() kho_retrieve_subtree()
>
> State machine
> ===========
> register_kho_notifier() / unregister_kho_notifier()
>
> kho_finalize() / kho_abort()
>
> We should remove the "State machine", and only keep the "Preserve
> Memory" API functions. At the time these functions are called, KHO
> should do the magic of making sure that the memory gets preserved
> across the reboot.
>
> This way, reserve_mem_init() would call: kho_preserve_folio() and
> kho_add_subtree() during boot, and be done with it.
I agree that there's no need in notifiers.
I even have a half cooked patch for this on top of "kho: allow to drive kho
from within kernel"