linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] Drivers: base: memory: Export symbols for onlining memory blocks
@ 2013-07-19 19:23 K. Y. Srinivasan
  2013-07-22  3:16 ` Jason Wang
                   ` (2 more replies)
  0 siblings, 3 replies; 21+ messages in thread
From: K. Y. Srinivasan @ 2013-07-19 19:23 UTC (permalink / raw)
  To: gregkh, linux-kernel, devel, olaf, apw, andi, akpm, linux-mm,
	kamezawa.hiroyuki, mhocko, hannes, yinghan, jasowang, kay
  Cc: K. Y. Srinivasan

The current machinery for hot-adding memory requires having udev
rules to bring the memory segments online. Export the necessary functionality
to to bring the memory segment online without involving user space code. 

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
---
 drivers/base/memory.c  |    5 ++++-
 include/linux/memory.h |    4 ++++
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/drivers/base/memory.c b/drivers/base/memory.c
index 2b7813e..a8204ac 100644
--- a/drivers/base/memory.c
+++ b/drivers/base/memory.c
@@ -328,7 +328,7 @@ static int __memory_block_change_state_uevent(struct memory_block *mem,
 	return ret;
 }
 
-static int memory_block_change_state(struct memory_block *mem,
+int memory_block_change_state(struct memory_block *mem,
 		unsigned long to_state, unsigned long from_state_req,
 		int online_type)
 {
@@ -341,6 +341,8 @@ static int memory_block_change_state(struct memory_block *mem,
 
 	return ret;
 }
+EXPORT_SYMBOL(memory_block_change_state);
+
 static ssize_t
 store_mem_state(struct device *dev,
 		struct device_attribute *attr, const char *buf, size_t count)
@@ -540,6 +542,7 @@ struct memory_block *find_memory_block(struct mem_section *section)
 {
 	return find_memory_block_hinted(section, NULL);
 }
+EXPORT_SYMBOL(find_memory_block);
 
 static struct attribute *memory_memblk_attrs[] = {
 	&dev_attr_phys_index.attr,
diff --git a/include/linux/memory.h b/include/linux/memory.h
index 85c31a8..8e3ede5 100644
--- a/include/linux/memory.h
+++ b/include/linux/memory.h
@@ -115,6 +115,10 @@ extern void unregister_memory_notifier(struct notifier_block *nb);
 extern int register_memory_isolate_notifier(struct notifier_block *nb);
 extern void unregister_memory_isolate_notifier(struct notifier_block *nb);
 extern int register_new_memory(int, struct mem_section *);
+extern int memory_block_change_state(struct memory_block *mem,
+		unsigned long to_state, unsigned long from_state_req,
+		int online_type);
+
 #ifdef CONFIG_MEMORY_HOTREMOVE
 extern int unregister_memory_section(struct mem_section *);
 #endif
-- 
1.7.4.1

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply related	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2013-07-25 16:35 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-07-19 19:23 [PATCH 1/1] Drivers: base: memory: Export symbols for onlining memory blocks K. Y. Srinivasan
2013-07-22  3:16 ` Jason Wang
2013-07-22 12:37 ` Michal Hocko
2013-07-23 14:52   ` KY Srinivasan
2013-07-23 15:09     ` Michal Hocko
2013-07-23 15:50       ` KY Srinivasan
2013-07-23 15:28     ` Dave Hansen
2013-07-23 15:54       ` KY Srinivasan
2013-07-23 16:00         ` Dave Hansen
2013-07-23 17:21           ` KY Srinivasan
2013-07-24 16:43             ` Dave Hansen
2013-07-24 19:45               ` KY Srinivasan
2013-07-24 21:02                 ` Dave Hansen
2013-07-25  7:57                   ` Michal Hocko
2013-07-25 11:14                     ` KY Srinivasan
2013-07-25 15:03                       ` Dave Hansen
2013-07-25 15:15                         ` Kay Sievers
2013-07-25 16:35                           ` Dave Hansen
2013-07-25 15:49                         ` KY Srinivasan
2013-07-23 16:01 ` Greg KH
2013-07-23 16:54   ` KY Srinivasan

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).