Re: [PATCH v10 0/4] mm/vmalloc: free unused pages on vrealloc() shrink

Shivam Kalra
2026-04-17T13:35:46Z

On 16/04/26 00:14, Uladzislau Rezki wrote:
> Yep, the problem reported by Sashiko regarding area->size and vread_iter()
> is correct. V10 does not address this.
>
> I am not sure that reducing vma size is a good approach here. It is
> widely used and we might end up with fixing even more corner cases.
>
> vread_iter() and vm-size calculation there should be fixed.
>
> --
> Uladzislau Rezki
Proposed Change for v11:

long vread_iter(struct iov_iter *iter, const char *addr, size_t count)
{
struct vmap_node *vn;
struct vmap_area *va;
struct vm_struct *vm;
char *vaddr;
<snip>
vaddr = (char *) va->va_start;
size = vm ? get_vm_area_size(vm) : va_size(va);

if (vm && vm->nr_pages)
size = min(size, (size_t)vm->nr_pages << PAGE_SHIFT);

<snip>