提交 117090b5 编写于 作者: A Andi Kleen 提交者: Linus Torvalds

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

Use pcibus_to_node directly
Signed-off-by: NAndi Kleen <ak@suse.de>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 1d3fbbf9
...@@ -191,11 +191,9 @@ static void *dma_alloc_pages(struct device *dev, unsigned gfp, unsigned order) ...@@ -191,11 +191,9 @@ static void *dma_alloc_pages(struct device *dev, unsigned gfp, unsigned order)
{ {
struct page *page; struct page *page;
int node; int node;
if (dev->bus == &pci_bus_type) { if (dev->bus == &pci_bus_type)
cpumask_t mask; node = pcibus_to_node(to_pci_dev(dev)->bus);
mask = pcibus_to_cpumask(to_pci_dev(dev)->bus); else
node = cpu_to_node(first_cpu(mask));
} else
node = numa_node_id(); node = numa_node_id();
page = alloc_pages_node(node, gfp, order); page = alloc_pages_node(node, gfp, order);
return page ? page_address(page) : NULL; return page ? page_address(page) : NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册