]> git.karo-electronics.de Git - karo-tx-linux.git/commit
arch/x86/kernel/pci-dma.c: avoid duplicated memset in dma_generic_alloc_coherent()
authorAkinobu Mita <akinobu.mita@gmail.com>
Wed, 14 May 2014 00:01:39 +0000 (10:01 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Wed, 14 May 2014 00:01:39 +0000 (10:01 +1000)
commit51f8b6df18d16933987a51df717d5ff7f98cd48e
tree6049585e78a7d39e69f8df87e73d88004a29be39
parent8eb3d4b4d39c8efa3c1158bc0df5b60ff181804b
arch/x86/kernel/pci-dma.c: avoid duplicated memset in dma_generic_alloc_coherent()

Fix a duplicated memset that was introduced by the patch
x86-make-dma_alloc_coherent-return-zeroed-memory-if-cma-is-enabled.patch
in -mm tree, and this change should be folded into it.

If dma_generic_alloc_coherent() is called with __GFP_ZERO, it does a
duplicated memset to the memory area allocated by alloc_pages_node() with
__GFP_ZERO.  This change fixes that inefficiency by clearing __GFP_ZERO
bit in gfp flages before calling alloc_pages_node().  Note that
dma_generic_alloc_coherent() always returns zeroed memory.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Cc: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: David Woodhouse <dwmw2@infradead.org>
Cc: Don Dutile <ddutile@redhat.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Andi Kleen <andi@firstfloor.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/x86/kernel/pci-dma.c