Re: [PATCH v4 2/2] kho: Introduce preserve/restore APIs for high-order pages
Pratyush Yadav <[email protected]>
| Newsgroups | org.infradead.lists.kexec,org.kernel.vger.linux-kernel,org.kvack.linux-mm |
|---|---|
| Message-ID | <[email protected]> |
On Mon, Aug 03 2026, Pranjal Shrivastava wrote: > The current KHO page preservation APIs (e.g. kho_preserve_pages) assume > that multi-page blocks are split into independent 4KB pages during > restoration. This is incompatible with high-order non-compound pages, > such as DMA buffers, which must be restored with tail pages having a > zero reference count. > > Introduce explicit preserve and restore APIs for high-order pages, > which preserve and restore a high-order page block as a single unit, > applying a refcount of 1 to the head page while leaving tail pages at 0. > Rename the existing internal helper to __kho_restore_page() and > consolidate the common restoration code into it. > > Signed-off-by: Pranjal Shrivastava <[email protected]> The code here looks very convoluted TBH. I think it will be simpler to make kho_restore_page() only return non-compound pages. That is, it returns 0 or higher order non-compound page. Then kho_restore_pages() can call kho_restore_page() and then do split_page() on the page it got to turn it into 0-order pages. kho_restore_folio() can call kho_restore_page() and then do prep_compound_page() on the page it got. And then you expose kho_restore_page() to be used by DMA APIs to get non-compound high order pages directly. How does that sound? [...] -- Regards, Pratyush Yadav