lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <546559B2.4090003@codeaurora.org>
Date:	Thu, 13 Nov 2014 17:24:02 -0800
From:	Laura Abbott <lauraa@...eaurora.org>
To:	Gioh Kim <gioh.kim@....com>, Colin Cross <ccross@...roid.com>,
	Joonsoo Kim <js1304@...il.com>
CC:	John Stultz <john.stultz@...aro.org>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org,
	"ÀÌ°ÇÈ£/Ã¥ÀÓ¿¬±¸¿ø/SW Platform(¿¬)AOTÆÀ(gunho.lee@....com)" <gunho.lee@....com>
Subject: Re: Why does ion_cma_allocate need GFP_HIGHUSER | __GFP_ZERO flags?

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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ