From: Laura Abbott <lauraa@codeaurora.org>
To: Gioh Kim <gioh.kim@lge.com>, Colin Cross <ccross@android.com>,
Joonsoo Kim <js1304@gmail.com>
Cc: "John Stultz" <john.stultz@linaro.org>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
"\"이건호/책임연구원/SW Platform(연)AOT팀(gunho.lee@lge.com)\""
<gunho.lee@lge.com>
Subject: Re: Why does ion_cma_allocate need GFP_HIGHUSER | __GFP_ZERO flags?
Date: Thu, 13 Nov 2014 17:24:02 -0800 [thread overview]
Message-ID: <546559B2.4090003@codeaurora.org> (raw)
In-Reply-To: <54645B38.10603@lge.com>
On 11/12/2014 11:18 PM, Gioh Kim wrote:
> Hi,
>
> I'm wondering why dma_alloc_coherent needs GFP_HIGHUSER | __GFP_ZERO flags in ion_cma_allocate().
>
> I think dma_alloc_coherent can go to __dma_alloc if the system has CMA area.
> If __GFP_WAIT flag is set, it allocates memory from atomic pool.
> So I think calling dma_alloc_coherent with __GFP_WAIT is enough.
>
> And can I get zero-filled-memory from CMA if I set __GFP_ZERO?
>
>
If we are actually using CMA, the GFP flags don't make much of a difference. If
we didn't have CMA, using GFP_HIGHUSER would still be appropriate. The memory
is going to userspace so the user part is necessary and there should be no need
for a lowmem mapping so highmem can be used. __GFP_ZERO might be redundant since
the dma layer zeros memory anyway but it's probably safe.
I think the flags should be fine as is.
Thanks,
Laura
--
Qualcomm Innovation Center, Inc.
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project
next prev parent reply other threads:[~2014-11-14 1:24 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-13 7:18 Why does ion_cma_allocate need GFP_HIGHUSER | __GFP_ZERO flags? Gioh Kim
2014-11-14 1:24 ` Laura Abbott [this message]
2014-11-14 1:38 ` Gioh Kim
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=546559B2.4090003@codeaurora.org \
--to=lauraa@codeaurora.org \
--cc=ccross@android.com \
--cc=devel@driverdev.osuosl.org \
--cc=gioh.kim@lge.com \
--cc=gregkh@linuxfoundation.org \
--cc=gunho.lee@lge.com \
--cc=john.stultz@linaro.org \
--cc=js1304@gmail.com \
--cc=linux-kernel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.