]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - arch/sh/mm/init.c
Merge branch 'v28-range-hrtimers-for-linus-v2' of git://git.kernel.org/pub/scm/linux...
[linux-2.6-omap-h63xx.git] / arch / sh / mm / init.c
index f1a494283c4ee9341a35d92879f3f3ab24f44188..4abf00031daef8521e39d09a1d032f1d937b26af 100644 (file)
@@ -123,7 +123,6 @@ void __init page_table_range_init(unsigned long start, unsigned long end,
                if (!pmd_present(*pmd)) {
                        pte_t *pte_table;
                        pte_table = (pte_t *)alloc_bootmem_low_pages(PAGE_SIZE);
-                       memset(pte_table, 0, PAGE_SIZE);
                        pmd_populate_kernel(&init_mm, pmd, pte_table);
                }
 
@@ -266,6 +265,35 @@ void free_initrd_mem(unsigned long start, unsigned long end)
 }
 #endif
 
+#if THREAD_SHIFT < PAGE_SHIFT
+static struct kmem_cache *thread_info_cache;
+
+struct thread_info *alloc_thread_info(struct task_struct *tsk)
+{
+       struct thread_info *ti;
+
+       ti = kmem_cache_alloc(thread_info_cache, GFP_KERNEL);
+       if (unlikely(ti == NULL))
+               return NULL;
+#ifdef CONFIG_DEBUG_STACK_USAGE
+       memset(ti, 0, THREAD_SIZE);
+#endif
+       return ti;
+}
+
+void free_thread_info(struct thread_info *ti)
+{
+       kmem_cache_free(thread_info_cache, ti);
+}
+
+void thread_info_cache_init(void)
+{
+       thread_info_cache = kmem_cache_create("thread_info", THREAD_SIZE,
+                                             THREAD_SIZE, 0, NULL);
+       BUG_ON(thread_info_cache == NULL);
+}
+#endif /* THREAD_SHIFT < PAGE_SHIFT */
+
 #ifdef CONFIG_MEMORY_HOTPLUG
 int arch_add_memory(int nid, u64 start, u64 size)
 {
@@ -293,21 +321,4 @@ int memory_add_physaddr_to_nid(u64 addr)
 }
 EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid);
 #endif
-
-#ifdef CONFIG_MEMORY_HOTREMOVE
-int remove_memory(u64 start, u64 size)
-{
-       unsigned long start_pfn = start >> PAGE_SHIFT;
-       unsigned long end_pfn = start_pfn + (size >> PAGE_SHIFT);
-       int ret;
-
-       ret = offline_pages(start_pfn, end_pfn, 120 * HZ);
-       if (unlikely(ret))
-               printk("%s: Failed, offline_pages() == %d\n", __func__, ret);
-
-       return ret;
-}
-EXPORT_SYMBOL_GPL(remove_memory);
-#endif
-
 #endif /* CONFIG_MEMORY_HOTPLUG */