From: David Hildenbrand <david@redhat.com>
To: Chen Li <chenli@uniontech.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] nommu: remove __GFP_HIGHMEM in vmalloc/vzalloc
Date: Wed, 5 May 2021 13:14:22 +0200 [thread overview]
Message-ID: <a15f99c4-14a9-8f81-6fd9-45caa46ebc72@redhat.com> (raw)
In-Reply-To: <875z00rnp8.wl-chenli@uniontech.com>
On 03.05.21 14:44, Chen Li wrote:
>
> From mm/nommu.c:
> void *__vmalloc(unsigned long size, gfp_t gfp_mask)
> {
> /*
> * You can't specify __GFP_HIGHMEM with kmalloc() since kmalloc()
> * returns only a logical address.
> */
> return kmalloc(size, (gfp_mask | __GFP_COMP) & ~__GFP_HIGHMEM);
> }
>
> nommu's __vmalloc just uses kmalloc internally and elimitates __GFP_HIGHMEM,
> so it makes no sense to add __GFP_HIGHMEM for nommu's vmalloc/vzalloc.
>
> Signed-off-by: Chen Li <chenli@uniontech.com>
> ---
> mm/nommu.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/mm/nommu.c b/mm/nommu.c
> index 5c9ab799c0e6..339a2f2eb1aa 100644
> --- a/mm/nommu.c
> +++ b/mm/nommu.c
> @@ -233,7 +233,7 @@ long vwrite(char *buf, char *addr, unsigned long count)
> */
> void *vmalloc(unsigned long size)
> {
> - return __vmalloc(size, GFP_KERNEL | __GFP_HIGHMEM);
> + return __vmalloc(size, GFP_KERNEL);
> }
> EXPORT_SYMBOL(vmalloc);
>
> @@ -251,7 +251,7 @@ EXPORT_SYMBOL(vmalloc);
> */
> void *vzalloc(unsigned long size)
> {
> - return __vmalloc(size, GFP_KERNEL | __GFP_HIGHMEM | __GFP_ZERO);
> + return __vmalloc(size, GFP_KERNEL | __GFP_ZERO);
> }
> EXPORT_SYMBOL(vzalloc);
>
>
Reviewed-by: David Hildenbrand <david@redhat.com>
--
Thanks,
David / dhildenb
prev parent reply other threads:[~2021-05-05 11:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-03 12:44 [PATCH] nommu: remove __GFP_HIGHMEM in vmalloc/vzalloc Chen Li
2021-05-03 13:05 ` Matthew Wilcox
2021-05-05 11:14 ` David Hildenbrand [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=a15f99c4-14a9-8f81-6fd9-45caa46ebc72@redhat.com \
--to=david@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=chenli@uniontech.com \
--cc=linux-kernel@vger.kernel.org \
--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;
as well as URLs for NNTP newsgroup(s).