Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 149676
b: refs/heads/master
c: b46b694
h: refs/heads/master
v: v3
  • Loading branch information
Benjamin Herrenschmidt committed Jun 9, 2009
1 parent dc74ff6 commit 5b8dc8a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 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: 3035c8634f0538a0c6946e3191bb6c9284b63798
refs/heads/master: b46b6942b39e577fe3ef1af928cd927864011247
7 changes: 4 additions & 3 deletions trunk/arch/powerpc/mm/mmu_context_nohash.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ static unsigned int next_context, nr_free_contexts;
static unsigned long *context_map;
static unsigned long *stale_map[NR_CPUS];
static struct mm_struct **context_mm;
static spinlock_t context_lock = SPIN_LOCK_UNLOCKED;
static DEFINE_SPINLOCK(context_lock);

#define CTX_MAP_SIZE \
(sizeof(unsigned long) * (last_context / BITS_PER_LONG + 1))
Expand Down Expand Up @@ -276,14 +276,15 @@ int init_new_context(struct task_struct *t, struct mm_struct *mm)
*/
void destroy_context(struct mm_struct *mm)
{
unsigned long flags;
unsigned int id;

if (mm->context.id == MMU_NO_CONTEXT)
return;

WARN_ON(mm->context.active != 0);

spin_lock(&context_lock);
spin_lock_irqsave(&context_lock, flags);
id = mm->context.id;
if (id != MMU_NO_CONTEXT) {
__clear_bit(id, context_map);
Expand All @@ -294,7 +295,7 @@ void destroy_context(struct mm_struct *mm)
context_mm[id] = NULL;
nr_free_contexts++;
}
spin_unlock(&context_lock);
spin_unlock_irqrestore(&context_lock, flags);
}

#ifdef CONFIG_SMP
Expand Down

0 comments on commit 5b8dc8a

Please sign in to comment.