Skip to content

Commit

Permalink
From patchwork series 377391
Browse files Browse the repository at this point in the history
  • Loading branch information
Fox Snowpatch committed Oct 12, 2023
1 parent b8b05bc commit e981e0e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
5 changes: 2 additions & 3 deletions arch/powerpc/include/asm/book3s/64/tlbflush-hash.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ static inline void arch_enter_lazy_mmu_mode(void)
*/
preempt_disable();
batch = this_cpu_ptr(&ppc64_tlb_batch);
batch->active = 1;
batch->active++;
}

static inline void arch_leave_lazy_mmu_mode(void)
Expand All @@ -49,9 +49,8 @@ static inline void arch_leave_lazy_mmu_mode(void)
return;
batch = this_cpu_ptr(&ppc64_tlb_batch);

if (batch->index)
if ((--batch->active == 0) && batch->index)
__flush_tlb_pending(batch);
batch->active = 0;
preempt_enable();
}

Expand Down
5 changes: 2 additions & 3 deletions arch/sparc/mm/tlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,16 +54,15 @@ void arch_enter_lazy_mmu_mode(void)
{
struct tlb_batch *tb = this_cpu_ptr(&tlb_batch);

tb->active = 1;
tb->active++;
}

void arch_leave_lazy_mmu_mode(void)
{
struct tlb_batch *tb = this_cpu_ptr(&tlb_batch);

if (tb->tlb_nr)
if ((--tb->active == 0) && tb->tlb_nr)
flush_tlb_pending();
tb->active = 0;
}

static void tlb_batch_add_one(struct mm_struct *mm, unsigned long vaddr,
Expand Down

0 comments on commit e981e0e

Please sign in to comment.