nvme: avoid crashes when node 0 is memoryless node.
PATCH 1/1 nvme: avoid crashes when node 0 is memoryless node.
When CONFIG_NUMA is enabled and node 0 is memoryless, the system crashes because nvme_probe() sets the device->numa_node to 0 by set_dev_node(&pdev->dev, 0), so it tries to allocate memory from node 0. To avoid the crash, we should change the 0 to first_memory_node.
--- drivers/nvme/host/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvme/host/pci.c +1 -1
@@ -1940,7 +1940,7 @@ static int nvme_probe(struct pci_dev *pdev, const struct pci_device_id *id) node =dev_to_node (&pdev->dev);if (node ==NUMA_NO_NODE ) -set_dev_node (&pdev->dev,0 ); +set_dev_node (&pdev->dev, first_memory_node); dev =kzalloc_node (sizeof (*dev),GFP_KERNEL , node);if (!dev)
Signature · 1 line
1.8.3.1
PATCH 1/1 nvme: avoid crashes when node 0 is memoryless node.
Quoted 6 lines · Masayoshi Mizuma
When
CONFIG_NUMAis enabled and node 0 is memoryless, the system crashes becausenvme_probe()sets thedevice->numa_nodeto 0 byset_dev_node(&pdev->dev, 0), so it tries to allocate memory from node 0. To avoid the crash, we should change the 0 tofirst_memory_node.Signed-off-by Masayoshi Mizuma <m.mizuma at jp.fujitsu.com>
Signature · 6 lines
Johannes Thumshirn Storage jthumshirn at suse.de +49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 N?rnberg GF: Felix Imend?rffer, Jane Smithard, Graham Norton HRB 21284 (AG N?rnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
PATCH 1/1 nvme: avoid crashes when node 0 is memoryless node.
In reply to Masayoshi MizumaQuoted 6 lines · Masayoshi Mizuma
When
CONFIG_NUMAis enabled and node 0 is memoryless, the system crashes becausenvme_probe()sets thedevice->numa_nodeto 0 byset_dev_node(&pdev->dev, 0), so it tries to allocate memory from node 0. To avoid the crash, we should change the 0 tofirst_memory_node.Signed-off-by Masayoshi Mizuma <m.mizuma at jp.fujitsu.com>
Thanks for the fix.
PATCH 1/1 nvme: avoid crashes when node 0 is memoryless node.
Keith and Johannes, thank you for reviewing!
Jens, please add this patch for 4.8.
- Masayoshi Mizuma
Quoted 17 lines · On Mon, 20 Jun 2016 11:44:39 -0400 Keith Busch wrote:
Quoted 6 lines · Masayoshi Mizuma
When
CONFIG_NUMAis enabled and node 0 is memoryless, the system crashes becausenvme_probe()sets thedevice->numa_nodeto 0 byset_dev_node(&pdev->dev, 0), so it tries to allocate memory from node 0. To avoid the crash, we should change the 0 tofirst_memory_node.Signed-off-by Masayoshi Mizuma <m.mizuma at jp.fujitsu.com>Thanks for the fix.
Reviewed-by Keith Busch <keith.busch at intel.com>_______________________________________________
Linux-nvme mailing list
Linux-nvme at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
PATCH 1/1 nvme: avoid crashes when node 0 is memoryless node.
Quoted 4 lines · Masayoshi Mizuma
Keith and Johannes, thank you for reviewing!
Jens, please add this patch for 4.8.
Added, thanks.
Signature · 1 line
Jens Axboe