Re: [PATCH 07/12] kho: allow destroying KHO radix tree

From: Pratyush Yadav

Date: Fri May 22 2026 - 10:00:20 EST


On Thu, May 21 2026, Pasha Tatashin wrote:

> On 04-29 15:39, Pratyush Yadav wrote:
>> From: "Pratyush Yadav (Google)" <pratyush@xxxxxxxxxx>
>>
>> Add kho_radix_destroy_tree() which allows destroying the radix tree and
>> freeing all its pages.
>>
>> Signed-off-by: Pratyush Yadav (Google) <pratyush@xxxxxxxxxx>
>> ---
>> include/linux/kho_radix_tree.h | 3 +++
>> kernel/liveupdate/kexec_handover.c | 34 ++++++++++++++++++++++++++++++
>> 2 files changed, 37 insertions(+)
>
> Generally, in Linux, recursion is avoided due to statically sized kernel
> stacks. However, here we are bound by a relatively shallow KHO tree, and
> kho_radix_walk_tree() is already recursive, so I think it is alright. We
> just need to be mindful of local variable usage (frame sizes) within these
> recursive functions.

Yep, recursion is strictly bounded and the depth is no worse than any
page table walkers for example.

>
> Reviewed-by: Pasha Tatashin <pasha.tatashin@xxxxxxxxxx>

Thanks!

--
Regards,
Pratyush Yadav