linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* vrealloc() shrink TODO
@ 2026-01-06 23:48 Laveesh Bansal
  0 siblings, 0 replies; only message in thread
From: Laveesh Bansal @ 2026-01-06 23:48 UTC (permalink / raw)
  To: dakr; +Cc: linux-mm

Hi Danilo,

I came across the TODO you left in vrealloc_node_align_noprof() (mm/vmalloc.c:4317) about shrinking the vm_area when reallocating to a smaller size. I'd like to work on this if it's still relevant.

I wanted to check if this approach makes sense: keep the virtual address range unchanged, unmap pages from the end using vunmap_range(), free them, and update nr_pages and memcg accounting. This would avoid vmap_area allocator complexity while still reclaiming physical memory.

One thing I'm not sure about: for huge page allocations (page_order > 0), partial unmapping seems problematic - should shrink just be skipped in that case?

A few questions:
1. Is this optimization still wanted?
2. Does the approach above make sense, or is there a better way?
3. Any preference on the shrink heuristic?
4. Anything else I should watch out for?

Thanks,
Laveesh


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-01-06 23:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-06 23:48 vrealloc() shrink TODO Laveesh Bansal

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox