Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=33d63bd83bf9aa6b662a376a96b825acba721e8f
Commit:     33d63bd83bf9aa6b662a376a96b825acba721e8f
Parent:     05a117847b43d44f336bbf272a1063661431a5e5
Author:     Paul Mundt <[EMAIL PROTECTED]>
AuthorDate: Thu Jun 7 11:32:52 2007 +0900
Committer:  Paul Mundt <[EMAIL PROTECTED]>
CommitDate: Fri Jun 8 02:43:51 2007 +0000

    sh: memory hot-add for sparsemem users support.
    
    This enables simple hotplug support for sparsemem users. Presently
    this only permits memory being added in to node 0 on ZONE_NORMAL.
    
    Signed-off-by: Paul Mundt <[EMAIL PROTECTED]>
---
 arch/sh/mm/Kconfig |    8 ++++++++
 arch/sh/mm/init.c  |   42 ++++++++++++++++++++++++++++++++++++++++++
 mm/Kconfig         |    2 +-
 3 files changed, 51 insertions(+), 1 deletions(-)

diff --git a/arch/sh/mm/Kconfig b/arch/sh/mm/Kconfig
index c713d13..0c24abd 100644
--- a/arch/sh/mm/Kconfig
+++ b/arch/sh/mm/Kconfig
@@ -331,6 +331,14 @@ config ARCH_POPULATES_NODE_MAP
 config ARCH_SELECT_MEMORY_MODEL
        def_bool y
 
+config ARCH_ENABLE_MEMORY_HOTPLUG
+       def_bool y
+       depends on SPARSEMEM
+
+config ARCH_MEMORY_PROBE
+       def_bool y
+       depends on MEMORY_HOTPLUG
+
 choice
        prompt "Kernel page size"
        default PAGE_SIZE_4KB
diff --git a/arch/sh/mm/init.c b/arch/sh/mm/init.c
index 753e11d..40d4e79 100644
--- a/arch/sh/mm/init.c
+++ b/arch/sh/mm/init.c
@@ -265,3 +265,45 @@ void free_initrd_mem(unsigned long start, unsigned long 
end)
        printk("Freeing initrd memory: %ldk freed\n", (end - start) >> 10);
 }
 #endif
+
+#ifdef CONFIG_MEMORY_HOTPLUG
+void online_page(struct page *page)
+{
+       ClearPageReserved(page);
+       init_page_count(page);
+       __free_page(page);
+       totalram_pages++;
+       num_physpages++;
+}
+
+int arch_add_memory(int nid, u64 start, u64 size)
+{
+       pg_data_t *pgdat;
+       unsigned long start_pfn = start >> PAGE_SHIFT;
+       unsigned long nr_pages = size >> PAGE_SHIFT;
+       int ret;
+
+       pgdat = NODE_DATA(nid);
+
+       /* We only have ZONE_NORMAL, so this is easy.. */
+       ret = __add_pages(pgdat->node_zones + ZONE_NORMAL, start_pfn, nr_pages);
+       if (unlikely(ret))
+               printk("%s: Failed, __add_pages() == %d\n", __FUNCTION__, ret);
+
+       return ret;
+}
+EXPORT_SYMBOL_GPL(arch_add_memory);
+
+int remove_memory(u64 start, u64 size)
+{
+       return -EINVAL;
+}
+EXPORT_SYMBOL_GPL(remove_memory);
+
+int memory_add_physaddr_to_nid(u64 addr)
+{
+       /* Node 0 for now.. */
+       return 0;
+}
+EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid);
+#endif
diff --git a/mm/Kconfig b/mm/Kconfig
index 8ac412b..62e5d0d 100644
--- a/mm/Kconfig
+++ b/mm/Kconfig
@@ -117,7 +117,7 @@ config MEMORY_HOTPLUG
        bool "Allow for memory hot-add"
        depends on SPARSEMEM || X86_64_ACPI_NUMA
        depends on HOTPLUG && !SOFTWARE_SUSPEND && ARCH_ENABLE_MEMORY_HOTPLUG
-       depends on (IA64 || X86 || PPC64)
+       depends on (IA64 || X86 || PPC64 || SUPERH)
 
 comment "Memory hotplug is currently incompatible with Software Suspend"
        depends on SPARSEMEM && HOTPLUG && SOFTWARE_SUSPEND
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to