diff options
author | Nicholas Piggin <npiggin@gmail.com> | 2023-05-24 16:08:19 +1000 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2023-08-02 22:22:18 +1000 |
commit | f74b2a6c01a0b319070ccee7dea0cc4dad694041 (patch) | |
tree | 15ee35bed11fd3913065932386d54ff15ad19fcf /arch/powerpc/include/asm/mmu_context.h | |
parent | c3c2e93753484bb4e935ed8205c1f569907f5970 (diff) |
powerpc/64s: Use dec_mm_active_cpus helper
Avoid open-coded atomic_dec on mm->context.active_cpus and use the
function made for it. Add CONFIG_DEBUG_VM underflow checking on the
counter.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20230524060821.148015-3-npiggin@gmail.com
Diffstat (limited to 'arch/powerpc/include/asm/mmu_context.h')
-rw-r--r-- | arch/powerpc/include/asm/mmu_context.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/mmu_context.h b/arch/powerpc/include/asm/mmu_context.h index 57f5017111f4..37bffa0f7918 100644 --- a/arch/powerpc/include/asm/mmu_context.h +++ b/arch/powerpc/include/asm/mmu_context.h @@ -127,6 +127,7 @@ static inline void inc_mm_active_cpus(struct mm_struct *mm) static inline void dec_mm_active_cpus(struct mm_struct *mm) { + VM_WARN_ON_ONCE(atomic_read(&mm->context.active_cpus) <= 0); atomic_dec(&mm->context.active_cpus); } |