File tree Expand file tree Collapse file tree 2 files changed +5
-14
lines changed Expand file tree Collapse file tree 2 files changed +5
-14
lines changed Original file line number Diff line number Diff line change @@ -1664,6 +1664,7 @@ config X86_PMEM_LEGACY
1664
1664
depends on PHYS_ADDR_T_64BIT
1665
1665
depends on BLK_DEV
1666
1666
select X86_PMEM_LEGACY_DEVICE
1667
+ select NUMA_KEEP_MEMINFO if NUMA
1667
1668
select LIBNVDIMM
1668
1669
help
1669
1670
Treat memory marked using the non-standard e820 type of 12 as used
Original file line number Diff line number Diff line change 7
7
#include <linux/memory_hotplug.h>
8
8
#include <linux/libnvdimm.h>
9
9
#include <linux/module.h>
10
+ #include <linux/numa.h>
10
11
11
12
static int e820_pmem_remove (struct platform_device * pdev )
12
13
{
@@ -16,27 +17,16 @@ static int e820_pmem_remove(struct platform_device *pdev)
16
17
return 0 ;
17
18
}
18
19
19
- #ifdef CONFIG_MEMORY_HOTPLUG
20
- static int e820_range_to_nid (resource_size_t addr )
21
- {
22
- return memory_add_physaddr_to_nid (addr );
23
- }
24
- #else
25
- static int e820_range_to_nid (resource_size_t addr )
26
- {
27
- return NUMA_NO_NODE ;
28
- }
29
- #endif
30
-
31
20
static int e820_register_one (struct resource * res , void * data )
32
21
{
33
22
struct nd_region_desc ndr_desc ;
34
23
struct nvdimm_bus * nvdimm_bus = data ;
24
+ int nid = phys_to_target_node (res -> start );
35
25
36
26
memset (& ndr_desc , 0 , sizeof (ndr_desc ));
37
27
ndr_desc .res = res ;
38
- ndr_desc .numa_node = e820_range_to_nid ( res -> start );
39
- ndr_desc .target_node = ndr_desc . numa_node ;
28
+ ndr_desc .numa_node = numa_map_to_online_node ( nid );
29
+ ndr_desc .target_node = nid ;
40
30
set_bit (ND_REGION_PAGEMAP , & ndr_desc .flags );
41
31
if (!nvdimm_pmem_region_create (nvdimm_bus , & ndr_desc ))
42
32
return - ENXIO ;
You can’t perform that action at this time.
0 commit comments