Commit 00fbc4fc authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] ppc64: Bug fix for hugepages on ppc64

From: David Gibson <david@gibson.dropbear.id.au>

Currently the flag indicating whether or not hugepages are allowed below
4GB is not correctly propagated across fork(), which can lead to oopses.
The patch below fixes this.
parent 810839dd
...@@ -81,6 +81,8 @@ init_new_context(struct task_struct *tsk, struct mm_struct *mm) ...@@ -81,6 +81,8 @@ init_new_context(struct task_struct *tsk, struct mm_struct *mm)
{ {
long head; long head;
unsigned long flags; unsigned long flags;
/* This does the right thing across a fork (I hope) */
unsigned long low_hpages = mm->context & CONTEXT_LOW_HPAGES;
spin_lock_irqsave(&mmu_context_queue.lock, flags); spin_lock_irqsave(&mmu_context_queue.lock, flags);
...@@ -91,6 +93,7 @@ init_new_context(struct task_struct *tsk, struct mm_struct *mm) ...@@ -91,6 +93,7 @@ init_new_context(struct task_struct *tsk, struct mm_struct *mm)
head = mmu_context_queue.head; head = mmu_context_queue.head;
mm->context = mmu_context_queue.elements[head]; mm->context = mmu_context_queue.elements[head];
mm->context |= low_hpages;
head = (head < LAST_USER_CONTEXT-1) ? head+1 : 0; head = (head < LAST_USER_CONTEXT-1) ? head+1 : 0;
mmu_context_queue.head = head; mmu_context_queue.head = head;
......
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