Commit 87f7c1e5 authored by Paul Mackerras's avatar Paul Mackerras Committed by Linus Torvalds

[PATCH] PPC64 mmu_context_init needs to run earlier

Using idr_get_new_above in init_new_context lets us get rid of an
awkward init function which wasn't running early enough in boot
anyway.
Signed-off-by: default avatarNathan Lynch <nathanl@austin.ibm.com>
Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 276ca536
...@@ -489,7 +489,7 @@ int init_new_context(struct task_struct *tsk, struct mm_struct *mm) ...@@ -489,7 +489,7 @@ int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
return -ENOMEM; return -ENOMEM;
spin_lock(&mmu_context_lock); spin_lock(&mmu_context_lock);
err = idr_get_new(&mmu_context_idr, NULL, &index); err = idr_get_new_above(&mmu_context_idr, NULL, 1, &index);
spin_unlock(&mmu_context_lock); spin_unlock(&mmu_context_lock);
if (err == -EAGAIN) if (err == -EAGAIN)
...@@ -518,19 +518,6 @@ void destroy_context(struct mm_struct *mm) ...@@ -518,19 +518,6 @@ void destroy_context(struct mm_struct *mm)
hugetlb_mm_free_pgd(mm); hugetlb_mm_free_pgd(mm);
} }
static int __init mmu_context_init(void)
{
int index;
/* Reserve the first (invalid) context*/
idr_pre_get(&mmu_context_idr, GFP_KERNEL);
idr_get_new(&mmu_context_idr, NULL, &index);
BUG_ON(0 != index);
return 0;
}
arch_initcall(mmu_context_init);
/* /*
* Do very early mm setup. * Do very early mm setup.
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment