2021-06-05 14:53:41

by Jim Cromie

[permalink] [raw]
Subject: how to return a chunk of kernel .data to free mem ?

I have convinced DYNAMIC_DEBUG code to not need
about 15% of its __dyndbg section, about 30kb on my test kernel.

This memory is not kmalloc'd, so krealloc wont work.
(I tried anyway, on a loaded module, it panicd)

Is there a way to return a chunk of init .data memory to general use ?

heres the patchset;
https://lore.kernel.org/lkml/[email protected]/


2021-06-09 14:39:48

by David Hildenbrand

[permalink] [raw]
Subject: Re: how to return a chunk of kernel .data to free mem ?

On 05.06.21 16:50, [email protected] wrote:
> I have convinced DYNAMIC_DEBUG code to not need
> about 15% of its __dyndbg section, about 30kb on my test kernel.
>
> This memory is not kmalloc'd, so krealloc wont work.
> (I tried anyway, on a loaded module, it panicd)
>
> Is there a way to return a chunk of init .data memory to general use ?
>
> heres the patchset;
> https://lore.kernel.org/lkml/[email protected]/
>

Hm, you could try free_reserved_page(). But obviously, only full pages
can be handed to the buddy.

--
Thanks,

David / dhildenb