|
@@ -685,14 +685,6 @@ static int add_memory_block(int base_section_nr)
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
-static bool is_zone_device_section(struct mem_section *ms)
|
|
|
|
-{
|
|
|
|
- struct page *page;
|
|
|
|
-
|
|
|
|
- page = sparse_decode_mem_map(ms->section_mem_map, __section_nr(ms));
|
|
|
|
- return is_zone_device_page(page);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
/*
|
|
/*
|
|
* need an interface for the VM to add new memory regions,
|
|
* need an interface for the VM to add new memory regions,
|
|
* but without onlining it.
|
|
* but without onlining it.
|
|
@@ -702,9 +694,6 @@ int register_new_memory(int nid, struct mem_section *section)
|
|
int ret = 0;
|
|
int ret = 0;
|
|
struct memory_block *mem;
|
|
struct memory_block *mem;
|
|
|
|
|
|
- if (is_zone_device_section(section))
|
|
|
|
- return 0;
|
|
|
|
-
|
|
|
|
mutex_lock(&mem_sysfs_mutex);
|
|
mutex_lock(&mem_sysfs_mutex);
|
|
|
|
|
|
mem = find_memory_block(section);
|
|
mem = find_memory_block(section);
|
|
@@ -741,11 +730,16 @@ static int remove_memory_section(unsigned long node_id,
|
|
{
|
|
{
|
|
struct memory_block *mem;
|
|
struct memory_block *mem;
|
|
|
|
|
|
- if (is_zone_device_section(section))
|
|
|
|
- return 0;
|
|
|
|
-
|
|
|
|
mutex_lock(&mem_sysfs_mutex);
|
|
mutex_lock(&mem_sysfs_mutex);
|
|
|
|
+
|
|
|
|
+ /*
|
|
|
|
+ * Some users of the memory hotplug do not want/need memblock to
|
|
|
|
+ * track all sections. Skip over those.
|
|
|
|
+ */
|
|
mem = find_memory_block(section);
|
|
mem = find_memory_block(section);
|
|
|
|
+ if (!mem)
|
|
|
|
+ goto out_unlock;
|
|
|
|
+
|
|
unregister_mem_sect_under_nodes(mem, __section_nr(section));
|
|
unregister_mem_sect_under_nodes(mem, __section_nr(section));
|
|
|
|
|
|
mem->section_count--;
|
|
mem->section_count--;
|
|
@@ -754,6 +748,7 @@ static int remove_memory_section(unsigned long node_id,
|
|
else
|
|
else
|
|
put_device(&mem->dev);
|
|
put_device(&mem->dev);
|
|
|
|
|
|
|
|
+out_unlock:
|
|
mutex_unlock(&mem_sysfs_mutex);
|
|
mutex_unlock(&mem_sysfs_mutex);
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|