From: Andi Kleen Date: Sat, 25 Mar 2006 15:30:43 +0000 (+0100) Subject: [PATCH] x86_64: Don't invoke OOM killer during dma_alloc_coherent() X-Git-Tag: firefly_0821_release~37117 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=3056d6be19b50cbd3f0290e816d702cc3e54a6f3;p=firefly-linux-kernel-4.4.55.git [PATCH] x86_64: Don't invoke OOM killer during dma_alloc_coherent() There is a fallback logic, so it's better to not use the OOM killer in the allocations. Signed-off-by: Andi Kleen Signed-off-by: Linus Torvalds --- diff --git a/arch/x86_64/kernel/pci-dma.c b/arch/x86_64/kernel/pci-dma.c index 4ed391edd47a..03c9eeedb0f3 100644 --- a/arch/x86_64/kernel/pci-dma.c +++ b/arch/x86_64/kernel/pci-dma.c @@ -73,6 +73,9 @@ dma_alloc_coherent(struct device *dev, size_t size, dma_addr_t *dma_handle, if (dma_mask == 0) dma_mask = 0xffffffff; + /* Don't invoke OOM killer */ + gfp |= __GFP_NORETRY; + /* Kludge to make it bug-to-bug compatible with i386. i386 uses the normal dma_mask for alloc_coherent. */ dma_mask &= *dev->dma_mask;