We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1180e73 commit 7a9b8bdCopy full SHA for 7a9b8bd
arch/x86/include/asm/pgtable-3level.h
@@ -2,8 +2,6 @@
2
#ifndef _ASM_X86_PGTABLE_3LEVEL_H
3
#define _ASM_X86_PGTABLE_3LEVEL_H
4
5
-#include <asm/atomic64_32.h>
6
-
7
/*
8
* Intel Physical Address Extension (PAE) Mode - three-level page
9
* tables on PPro+ CPUs.
@@ -95,11 +93,12 @@ static inline void pud_clear(pud_t *pudp)
95
93
#ifdef CONFIG_SMP
96
94
static inline pte_t native_ptep_get_and_clear(pte_t *ptep)
97
{
98
- pte_t res;
+ pte_t old = *ptep;
99
100
- res.pte = (pteval_t)arch_atomic64_xchg((atomic64_t *)ptep, 0);
+ do {
+ } while (!try_cmpxchg64(&ptep->pte, &old.pte, 0ULL));
101
102
- return res;
+ return old;
103
}
104
#else
105
#define native_ptep_get_and_clear(xp) native_local_ptep_get_and_clear(xp)
0 commit comments