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

Pratyush Yadav pratyush at kernel.org
Fri May 22 06:24:09 PDT 2026


On Thu, May 21 2026, Pasha Tatashin wrote:

> On 04-29 15:39, Pratyush Yadav wrote:
>> From: "Pratyush Yadav (Google)" <pratyush at kernel.org>
>> 
>> Add kho_radix_destroy_tree() which allows destroying the radix tree and
>> freeing all its pages.
>> 
>> Signed-off-by: Pratyush Yadav (Google) <pratyush at kernel.org>
>> ---
>>  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 at soleen.com> 

Thanks!

-- 
Regards,
Pratyush Yadav



More information about the kexec mailing list