Skip to content

Commit

Permalink
[SPARC64]: Disable preemption during flush_tlb_pending().
Browse files Browse the repository at this point in the history
A context switch will force a call to flush_tlb_pending() (via
switch_to()), so if we test tlb_nr to be non-zero, then sleep, it
would become zero and later back at the original context we'll pass
zero down into the TLB flushing code which should never see a nr
argument of zero.

Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
David S. Miller committed May 1, 2006
1 parent 1241140 commit c9f2946
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions arch/sparc64/mm/tlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <linux/percpu.h>
#include <linux/mm.h>
#include <linux/swap.h>
#include <linux/preempt.h>

#include <asm/pgtable.h>
#include <asm/pgalloc.h>
Expand All @@ -24,6 +25,8 @@ void flush_tlb_pending(void)
{
struct mmu_gather *mp = &__get_cpu_var(mmu_gathers);

preempt_disable();

if (mp->tlb_nr) {
flush_tsb_user(mp);

Expand All @@ -38,6 +41,8 @@ void flush_tlb_pending(void)
}
mp->tlb_nr = 0;
}

preempt_enable();
}

void tlb_batch_add(struct mm_struct *mm, unsigned long vaddr, pte_t *ptep, pte_t orig)
Expand Down

0 comments on commit c9f2946

Please sign in to comment.