Re: [Lsf-pc] [LSF/MM TOPIC] Matthew's minor MM topics

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon 29-01-18 04:37:45, Matthew Wilcox wrote:
> On Tue, Jan 23, 2018 at 01:26:46PM +0100, Michal Hocko wrote:
> > On Tue 16-01-18 06:13:54, Matthew Wilcox wrote:
> > > 3. Maybe we could rename kvfree() to just free()?  Please?  There's
> > > nothing special about it.  One fewer thing for somebody to learn when
> > > coming fresh to kernel programming.
> > 
> > I guess one has to learn about kvmalloc already and kvfree is nicely
> > symmetric to it.
> 
> I'd really like to get to:
> 
> #define malloc(sz)	kvmalloc(sz, GFP_KERNEL)
> #define free(p)		kvfree(p)
> #define realloc(p, sz)	kvrealloc(p, sz, GFP_KERNEL)	/* Doesn't exist yet */
> #define calloc(n, sz)	kvmalloc_array(n, sz, GFP_KERNEL)

Considering how many users we already have this is not really feasible.
I am also not sure we really want to mimic the userspace API. It is just
different with different consequences. You do not want to hide GFP
flags because this turned out to be just a bad idea in the past. Just
look at pte allocation functions which are unconditioanlly GFP_KERNEL
and all the pain that resulted in. We really want people to learn the
APIs and understand their limitations.
-- 
Michal Hocko
SUSE Labs

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]
  Powered by Linux