From: Michal Hocko <mhocko@kernel.org>
To: Matthew Wilcox <willy@infradead.org>
Cc: lsf-pc@lists.linux-foundation.org, linux-mm@kvack.org
Subject: Re: [Lsf-pc] [LSF/MM TOPIC] Matthew's minor MM topics
Date: Mon, 29 Jan 2018 13:48:16 +0100 [thread overview]
Message-ID: <20180129124816.GD21609@dhcp22.suse.cz> (raw)
In-Reply-To: <20180129123745.GC18247@bombadil.infradead.org>
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@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
prev parent reply other threads:[~2018-01-29 12:48 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-16 14:13 [LSF/MM TOPIC] Matthew's minor MM topics Matthew Wilcox
2018-01-23 12:26 ` [Lsf-pc] " Michal Hocko
2018-01-23 20:48 ` Matthew Wilcox
2018-01-24 8:56 ` Michal Hocko
2018-01-29 12:37 ` Matthew Wilcox
2018-01-29 12:48 ` Michal Hocko [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180129124816.GD21609@dhcp22.suse.cz \
--to=mhocko@kernel.org \
--cc=linux-mm@kvack.org \
--cc=lsf-pc@lists.linux-foundation.org \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).