Re: [TECH TOPIC] Implementing malloc

Matthew Wilcox <[email protected]> Thu, 9 Jul 2026 19:45:22 +0100
Newsgroups dev.linux.lists.ksummit
Message-ID <[email protected]>
On Thu, Jul 09, 2026 at 09:42:55PM +0300, Dan Carpenter wrote:
> On Thu, Jul 09, 2026 at 06:11:21PM +0100, Matthew Wilcox wrote:
> > I agree that many memory allocations benefit from providing more semantic
> > information to both the compiler and the runtime, as you suggest.
> > What I don't think we benefit from is "And you have to pass this magic
> > GFP_KERNEL argument too.  Unless it's GFP_ATOMIC or something".
> 
> You know that most people are using kzmalloc_obj() these days and so
> they don't pass GFP_KERNEL...

They are, they just don't know that they are.  Honestly, I think that's
almost worse.  Imagine if you could call kzmalloc_obj() from any context.
I think the instinct was right, but the implementation needs to be
done right.