Skip to content

Commit

Permalink
[IA64] Fix another IA64 preemption problem
Browse files Browse the repository at this point in the history
There's another problem shown up by Ingo's recent patch to make
smp_processor_id() complain if it's called with preemption enabled.
local_finish_flush_tlb_mm() calls activate_context() in a situation
where it could be rescheduled to another processor.  This patch
disables preemption around the call.

Signed-off-by: Peter Chubb <peterc@gelato.unsw.edu.au>
Signed-off-by: Tony Luck <tony.luck@intel.com>
  • Loading branch information
Peter Chubb authored and Tony Luck committed Jun 28, 2005
1 parent 819c67e commit a68db76
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions arch/ia64/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,13 +231,16 @@ smp_flush_tlb_all (void)
void
smp_flush_tlb_mm (struct mm_struct *mm)
{
preempt_disable();
/* this happens for the common case of a single-threaded fork(): */
if (likely(mm == current->active_mm && atomic_read(&mm->mm_users) == 1))
{
local_finish_flush_tlb_mm(mm);
preempt_enable();
return;
}

preempt_enable();
/*
* We could optimize this further by using mm->cpu_vm_mask to track which CPUs
* have been running in the address space. It's not clear that this is worth the
Expand Down
3 changes: 3 additions & 0 deletions include/asm-ia64/mmu_context.h
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ reload_context (mm_context_t context)
ia64_srlz_i(); /* srlz.i implies srlz.d */
}

/*
* Must be called with preemption off
*/
static inline void
activate_context (struct mm_struct *mm)
{
Expand Down

0 comments on commit a68db76

Please sign in to comment.