Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

riscv: mm: ptep_get_and_clear(): avoid atomic ops when !CONFIG_SMP

When !CONFIG_SMP, there's no need for atomic operations in
ptep_get_and_clear(), so, similar to x86, let's not use atomics in
this case.

Cc: Alexandre Ghiti <alex@ghiti.fr>
Signed-off-by: Paul Walmsley <pjw@kernel.org>

+6
+6
arch/riscv/include/asm/pgtable.h
··· 660 660 static inline pte_t ptep_get_and_clear(struct mm_struct *mm, 661 661 unsigned long address, pte_t *ptep) 662 662 { 663 + #ifdef CONFIG_SMP 663 664 pte_t pte = __pte(atomic_long_xchg((atomic_long_t *)ptep, 0)); 665 + #else 666 + pte_t pte = *ptep; 667 + 668 + set_pte(ptep, __pte(0)); 669 + #endif 664 670 665 671 page_table_check_pte_clear(mm, pte); 666 672