Re: [PATCH] mm/vmalloc: make vm_struct.nr_pages an unsigned long
From: Artem Lytkin
Date: Thu Jul 30 2026 - 05:29:54 EST
On Wed, Jul 29, 2026 at 07:28:36PM +0100, Matthew Wilcox wrote:
> I'm not saying we shouldn't fix this, but it's all theoretical for now,
> right?
The 2^32 page part is, yes, and my opening sentence pointed at the wrong
thing.
What went wrong twice wasn't a page count, it was a byte count. nr_pages
is unsigned int, so nr_pages << PAGE_SHIFT is 32-bit arithmetic and wraps
at 4GiB of bytes, which is 2^20 pages. In vread_iter() that made
/proc/kcore hand back zeros for a 4GiB area as a successful read, and any
machine with more than 4GiB of memory can allocate one. So the reachable
part is 4GiB and the 16TiB framing was me leading with the wrong number.
To answer the other half of it, and Andrew's question too: no report
behind any of this, I found it reading the code. v2 says so in as many
words.
Artem