Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 149675
b: refs/heads/master
c: 3035c86
h: refs/heads/master
i:
  149673: 3b1fd86
  149671: 5245829
v: v3
  • Loading branch information
Benjamin Herrenschmidt committed Jun 9, 2009
1 parent 8f3ca4e commit dc74ff6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ec097c84dff17511f2693e6ef6c3064dfbf0a3af
refs/heads/master: 3035c8634f0538a0c6946e3191bb6c9284b63798
12 changes: 8 additions & 4 deletions trunk/arch/powerpc/mm/mmu_context_nohash.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ static unsigned int steal_context_smp(unsigned int id)
struct mm_struct *mm;
unsigned int cpu, max;

again:
max = last_context - first_context;

/* Attempt to free next_context first and then loop until we manage */
Expand Down Expand Up @@ -108,7 +107,9 @@ static unsigned int steal_context_smp(unsigned int id)
spin_unlock(&context_lock);
cpu_relax();
spin_lock(&context_lock);
goto again;

/* This will cause the caller to try again */
return MMU_NO_CONTEXT;
}
#endif /* CONFIG_SMP */

Expand Down Expand Up @@ -194,6 +195,8 @@ void switch_mmu_context(struct mm_struct *prev, struct mm_struct *next)
WARN_ON(prev->context.active < 1);
prev->context.active--;
}

again:
#endif /* CONFIG_SMP */

/* If we already have a valid assigned context, skip all that */
Expand All @@ -212,7 +215,8 @@ void switch_mmu_context(struct mm_struct *prev, struct mm_struct *next)
#ifdef CONFIG_SMP
if (num_online_cpus() > 1) {
id = steal_context_smp(id);
goto stolen;
if (id == MMU_NO_CONTEXT)
goto again;
}
#endif /* CONFIG_SMP */
id = steal_context_up(id);
Expand Down Expand Up @@ -286,8 +290,8 @@ void destroy_context(struct mm_struct *mm)
mm->context.id = MMU_NO_CONTEXT;
#ifdef DEBUG_MAP_CONSISTENCY
mm->context.active = 0;
context_mm[id] = NULL;
#endif
context_mm[id] = NULL;
nr_free_contexts++;
}
spin_unlock(&context_lock);
Expand Down

0 comments on commit dc74ff6

Please sign in to comment.