Re: [PATCH] mm: Make kvmalloc refuse to allocate more than 2GB

From: Theodore Ts'o
Date: Thu Jul 22 2021 - 10:44:05 EST


On Wed, Jul 21, 2021 at 07:41:31PM +0100, Matthew Wilcox (Oracle) wrote:
> It's generally dangerous to allocate such large quantities of memory
> within the kernel owing to our propensity to use 'int' to represent
> a length. If somebody really needs it, we can add a kvmalloc_large()
> later, but let's default to "You can't allocate that much memory".

If we really need it, maybe we can add a GFP_LARGE_ALLOC to allow
allocations larger than 2GB later on? I can't quite see why that
would ever be needed, but that's probably a failure of my imagination. :-)

- Ted