* [PATCH] nvme: avoid crashes when node 0 is memoryless node.
@ 2016-06-20 0:33 Masayoshi Mizuma
2016-06-20 7:08 ` Johannes Thumshirn
2016-06-20 15:44 ` Keith Busch
0 siblings, 2 replies; 5+ messages in thread
From: Masayoshi Mizuma @ 2016-06-20 0:33 UTC (permalink / raw)
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.
Signed-off-by: Masayoshi Mizuma <m.mizuma at jp.fujitsu.com>
---
drivers/nvme/host/pci.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
index befac5b..a14d5e0 100644
--- a/drivers/nvme/host/pci.c
+++ b/drivers/nvme/host/pci.c
@@ -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)
--
1.8.3.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] nvme: avoid crashes when node 0 is memoryless node.
2016-06-20 0:33 [PATCH] nvme: avoid crashes when node 0 is memoryless node Masayoshi Mizuma
@ 2016-06-20 7:08 ` Johannes Thumshirn
2016-06-20 15:44 ` Keith Busch
1 sibling, 0 replies; 5+ messages in thread
From: Johannes Thumshirn @ 2016-06-20 7:08 UTC (permalink / raw)
On Mon, Jun 20, 2016@09:33:17AM +0900, Masayoshi Mizuma wrote:
> 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.
>
> Signed-off-by: Masayoshi Mizuma <m.mizuma at jp.fujitsu.com>
Reviewed-by: Johannes Thumshirn <jthumshirn at suse.de>
--
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] nvme: avoid crashes when node 0 is memoryless node.
2016-06-20 0:33 [PATCH] nvme: avoid crashes when node 0 is memoryless node Masayoshi Mizuma
2016-06-20 7:08 ` Johannes Thumshirn
@ 2016-06-20 15:44 ` Keith Busch
2016-07-13 6:13 ` Masayoshi Mizuma
1 sibling, 1 reply; 5+ messages in thread
From: Keith Busch @ 2016-06-20 15:44 UTC (permalink / raw)
On Mon, Jun 20, 2016@09:33:17AM +0900, Masayoshi Mizuma wrote:
> 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.
>
> Signed-off-by: Masayoshi Mizuma <m.mizuma at jp.fujitsu.com>
Thanks for the fix.
Reviewed-by: Keith Busch <keith.busch at intel.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] nvme: avoid crashes when node 0 is memoryless node.
2016-06-20 15:44 ` Keith Busch
@ 2016-07-13 6:13 ` Masayoshi Mizuma
2016-07-13 16:18 ` Jens Axboe
0 siblings, 1 reply; 5+ messages in thread
From: Masayoshi Mizuma @ 2016-07-13 6:13 UTC (permalink / raw)
Keith and Johannes, thank you for reviewing!
Jens, please add this patch for 4.8.
- Masayoshi Mizuma
On Mon, 20 Jun 2016 11:44:39 -0400 Keith Busch wrote:
> On Mon, Jun 20, 2016@09:33:17AM +0900, Masayoshi Mizuma wrote:
>> 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.
>>
>> 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
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] nvme: avoid crashes when node 0 is memoryless node.
2016-07-13 6:13 ` Masayoshi Mizuma
@ 2016-07-13 16:18 ` Jens Axboe
0 siblings, 0 replies; 5+ messages in thread
From: Jens Axboe @ 2016-07-13 16:18 UTC (permalink / raw)
On 07/12/2016 11:13 PM, Masayoshi Mizuma wrote:
>
> Keith and Johannes, thank you for reviewing!
>
> Jens, please add this patch for 4.8.
Added, thanks.
--
Jens Axboe
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2016-07-13 16:18 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-20 0:33 [PATCH] nvme: avoid crashes when node 0 is memoryless node Masayoshi Mizuma
2016-06-20 7:08 ` Johannes Thumshirn
2016-06-20 15:44 ` Keith Busch
2016-07-13 6:13 ` Masayoshi Mizuma
2016-07-13 16:18 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).