Re: [PATCH v2 1/2] mm/vmalloc: extract vmalloc_free_pages() helper from vfree()
From: Shivam Kalra
Date: Thu Mar 05 2026 - 03:14:15 EST
On 05/03/26 03:14, Alice Ryhl wrote:
> On Wed, Mar 04, 2026 at 08:23:15PM +0530, Shivam Kalra via B4 Relay wrote:
>> From: Shivam Kalra <shivamkalra98@xxxxxxxxxxx>
>>
>> Extract the page-freeing loop and NR_VMALLOC stat accounting from
>> vfree() into a reusable vmalloc_free_pages() helper. The helper operates
>> on a range [start, end) of pages from a vm_struct, making it suitable
>> for both full free (vfree) and partial free (upcoming vrealloc shrink).
>>
>> No functional change.
>>
>> Signed-off-by: Shivam Kalra <shivamkalra98@xxxxxxxxxxx>
>
>> - /*
>> - * High-order allocs for huge vmallocs are split, so
>> - * can be freed as an array of order-0 allocations
>> - */
>> - if (!(vm->flags & VM_MAP_PUT_PAGES))
>> - mod_lruvec_page_state(page, NR_VMALLOC, -1);
>
> Any reason this comment was dropped?
>
> Alice
Great catch. This regressed during the rebase. I will add this back in
the next version. However, I'll wait for more feedback before the next
version.