x86_64: fix dma_alloc_pages
PATCH 1/1 x86_64: fix dma_alloc_pages
one system with two nodes and two ht links on every node. the bios already have _pxm for two links.
when no ram installed for node1 will have panic.
reason: the device on second chain will get node = 1 from dev_to_node...via pci_acpi_scan_root.
but node1 doesn't have ram installed.
in dma_alloc_pages it will pass check with first_node(node_online_map)... and will have problem with __alloc_pages in alloc_pages_node.
this patch will check the if the node is online..., if not will get numa_node_id to get one node with ram.
arch/x86/kernel/pci-dma_64.c +1 -4
@@ -53,12 +53,9 @@ dma_alloc_pages(struct device *dev, gfp_t gfp, unsigned order)int node; node =dev_to_node (dev); -if (node ==-1 ) +if (node ==-1 || !node_online (node)) node =numa_node_id (); -if (node <first_node (node_online_map)) - node =first_node (node_online_map); - page =alloc_pages_node (node, gfp, order);return page ?page_address (page) :NULL ; }
Ingo Molnar
AppliedQuoted 5 lines · Yinghai Lu
one system with two nodes and two ht links on every node. the bios already have
_pxmfor two links.when no ram installed for node1 will have panic.
Quoted 8 lines
reason: the device on second chain will get node = 1 from dev_to_node...via
pci_acpi_scan_root. but node1 doesn't have ram installed. indma_alloc_pagesit will pass check withfirst_node(node_online_map)... and will have problem with__alloc_pagesinalloc_pages_node.this patch will check the if the node is online..., if not will get
numa_node_idto get one node with ram.
thanks, applied.
Ingo