From: David Rientjes <rientjes@google.com>
To: Oleg Drokin <green@linuxhacker.ru>
Cc: Andrew Morton <akpm@linux-foundation.org>, linux-mm@kvack.org
Subject: Re: [PATCH 1/2] mm: Export __vmalloc_node
Date: Mon, 2 Feb 2015 09:45:21 -0800 (PST) [thread overview]
Message-ID: <alpine.DEB.2.10.1502020940530.5117@chino.kir.corp.google.com> (raw)
In-Reply-To: <1422846627-26890-2-git-send-email-green@linuxhacker.ru>
On Sun, 1 Feb 2015, green@linuxhacker.ru wrote:
> From: Oleg Drokin <green@linuxhacker.ru>
>
> vzalloc_node helpfully suggests to use __vmalloc_node if a more tight
> control over allocation flags is needed, but in fact __vmalloc_node
> is not only not exported, it's also static, so could not be used
> outside of mm/vmalloc.c
> Make it to be available as it was apparently intended.
>
__vmalloc_node() is for the generalized functionality that is needed for
the vmalloc API and not part of the API itself. I think what you want to
do is add a vmalloc_node_gfp(), or more specifically a vzalloc_node_gfp(),
to do GFP_NOFS when needed.
> Signed-off-by: Oleg Drokin <green@linuxhacker.ru>
> ---
> include/linux/vmalloc.h | 3 +++
> mm/vmalloc.c | 10 ++++------
> 2 files changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
> index b87696f..7eb2c46 100644
> --- a/include/linux/vmalloc.h
> +++ b/include/linux/vmalloc.h
> @@ -73,6 +73,9 @@ extern void *vmalloc_exec(unsigned long size);
> extern void *vmalloc_32(unsigned long size);
> extern void *vmalloc_32_user(unsigned long size);
> extern void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot);
> +extern void *__vmalloc_node(unsigned long size, unsigned long align,
> + gfp_t gfp_mask, pgprot_t prot, int node,
> + const void *caller);
> extern void *__vmalloc_node_range(unsigned long size, unsigned long align,
> unsigned long start, unsigned long end, gfp_t gfp_mask,
> pgprot_t prot, int node, const void *caller);
> diff --git a/mm/vmalloc.c b/mm/vmalloc.c
> index 39c3388..b882d95 100644
> --- a/mm/vmalloc.c
> +++ b/mm/vmalloc.c
> @@ -1552,9 +1552,6 @@ void *vmap(struct page **pages, unsigned int count,
> }
> EXPORT_SYMBOL(vmap);
>
> -static void *__vmalloc_node(unsigned long size, unsigned long align,
> - gfp_t gfp_mask, pgprot_t prot,
> - int node, const void *caller);
> static void *__vmalloc_area_node(struct vm_struct *area, gfp_t gfp_mask,
> pgprot_t prot, int node)
> {
> @@ -1685,13 +1682,14 @@ fail:
> * allocator with @gfp_mask flags. Map them into contiguous
> * kernel virtual space, using a pagetable protection of @prot.
> */
> -static void *__vmalloc_node(unsigned long size, unsigned long align,
> - gfp_t gfp_mask, pgprot_t prot,
> - int node, const void *caller)
> +void *__vmalloc_node(unsigned long size, unsigned long align,
> + gfp_t gfp_mask, pgprot_t prot, int node,
> + const void *caller)
> {
> return __vmalloc_node_range(size, align, VMALLOC_START, VMALLOC_END,
> gfp_mask, prot, node, caller);
> }
> +EXPORT_SYMBOL(__vmalloc_node);
>
> void *__vmalloc(unsigned long size, gfp_t gfp_mask, pgprot_t prot)
> {
--
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>
next prev parent reply other threads:[~2015-02-02 17:45 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-02-02 3:10 [PATCH 0/2] Export __vmalloc_node symbol green
2015-02-02 3:10 ` [PATCH 1/2] mm: Export __vmalloc_node green
2015-02-02 17:45 ` David Rientjes [this message]
2015-02-02 20:31 ` Oleg Drokin
2015-02-02 3:10 ` [PATCH 2/2] staging/lustre: use __vmalloc_node() to avoid __GFP_FS default green
2015-02-02 17:48 ` David Rientjes
2015-02-02 23:26 ` Oleg Drokin
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=alpine.DEB.2.10.1502020940530.5117@chino.kir.corp.google.com \
--to=rientjes@google.com \
--cc=akpm@linux-foundation.org \
--cc=green@linuxhacker.ru \
--cc=linux-mm@kvack.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