diff options
author | Christian Borntraeger <borntraeger@de.ibm.com> | 2015-01-06 16:47:41 -0500 |
---|---|---|
committer | Christian Borntraeger <borntraeger@de.ibm.com> | 2015-01-19 08:14:19 -0500 |
commit | da1a288d8562739aa8ba0273d4fb6b73b856c0d3 (patch) | |
tree | 80d57ed776241fbcc48339d1ef1012cd39a5cf69 | |
parent | 5ee07612e9e20817bb99256ab6cf1400fd5aa270 (diff) |
ppc/hugetlbfs: Replace ACCESS_ONCE with READ_ONCE
ACCESS_ONCE does not work reliably on non-scalar types. For
example gcc 4.6 and 4.7 might remove the volatile tag for such
accesses during the SRA (scalar replacement of aggregates) step
(https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58145)
Change the ppc/hugetlbfs code to replace ACCESS_ONCE with READ_ONCE.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
-rw-r--r-- | arch/powerpc/mm/hugetlbpage.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/mm/hugetlbpage.c b/arch/powerpc/mm/hugetlbpage.c index 5ff4e07d920a..620d0ec93e6f 100644 --- a/arch/powerpc/mm/hugetlbpage.c +++ b/arch/powerpc/mm/hugetlbpage.c | |||
@@ -978,7 +978,7 @@ pte_t *find_linux_pte_or_hugepte(pgd_t *pgdir, unsigned long ea, unsigned *shift | |||
978 | */ | 978 | */ |
979 | pdshift = PUD_SHIFT; | 979 | pdshift = PUD_SHIFT; |
980 | pudp = pud_offset(&pgd, ea); | 980 | pudp = pud_offset(&pgd, ea); |
981 | pud = ACCESS_ONCE(*pudp); | 981 | pud = READ_ONCE(*pudp); |
982 | 982 | ||
983 | if (pud_none(pud)) | 983 | if (pud_none(pud)) |
984 | return NULL; | 984 | return NULL; |
@@ -990,7 +990,7 @@ pte_t *find_linux_pte_or_hugepte(pgd_t *pgdir, unsigned long ea, unsigned *shift | |||
990 | else { | 990 | else { |
991 | pdshift = PMD_SHIFT; | 991 | pdshift = PMD_SHIFT; |
992 | pmdp = pmd_offset(&pud, ea); | 992 | pmdp = pmd_offset(&pud, ea); |
993 | pmd = ACCESS_ONCE(*pmdp); | 993 | pmd = READ_ONCE(*pmdp); |
994 | /* | 994 | /* |
995 | * A hugepage collapse is captured by pmd_none, because | 995 | * A hugepage collapse is captured by pmd_none, because |
996 | * it mark the pmd none and do a hpte invalidate. | 996 | * it mark the pmd none and do a hpte invalidate. |