Skip to content

Commit

Permalink
[PATCH] x86-64: Micro optimization to dma_alloc_coherent node lookup
Browse files Browse the repository at this point in the history
Use pcibus_to_node directly

Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
  • Loading branch information
Andi Kleen authored and Linus Torvalds committed Sep 12, 2005
1 parent 1d3fbbf commit 117090b
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions arch/x86_64/kernel/pci-gart.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
else
node = numa_node_id();
page = alloc_pages_node(node, gfp, order);
return page ? page_address(page) : NULL;
Expand Down

0 comments on commit 117090b

Please sign in to comment.