Commit 117090b5 authored by Andi Kleen's avatar Andi Kleen Committed by Linus Torvalds
Browse files

[PATCH] x86-64: Micro optimization to dma_alloc_coherent node lookup

Use pcibus_to_node directly
Signed-off-by: default avatarAndi Kleen <>
Signed-off-by: default avatarLinus Torvalds <>
parent 1d3fbbf9
......@@ -191,11 +191,9 @@ static void *dma_alloc_pages(struct device *dev, unsigned gfp, unsigned order)
struct page *page;
int node;
if (dev->bus == &pci_bus_type) {
cpumask_t mask;
mask = pcibus_to_cpumask(to_pci_dev(dev)->bus);
node = cpu_to_node(first_cpu(mask));
} else
if (dev->bus == &pci_bus_type)
node = pcibus_to_node(to_pci_dev(dev)->bus);
node = numa_node_id();
page = alloc_pages_node(node, gfp, order);
return page ? page_address(page) : NULL;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment