提交 da1a288d 编写于 作者: C Christian Borntraeger

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: NChristian Borntraeger <borntraeger@de.ibm.com>
上级 5ee07612
...@@ -978,7 +978,7 @@ pte_t *find_linux_pte_or_hugepte(pgd_t *pgdir, unsigned long ea, unsigned *shift ...@@ -978,7 +978,7 @@ pte_t *find_linux_pte_or_hugepte(pgd_t *pgdir, unsigned long ea, unsigned *shift
*/ */
pdshift = PUD_SHIFT; pdshift = PUD_SHIFT;
pudp = pud_offset(&pgd, ea); pudp = pud_offset(&pgd, ea);
pud = ACCESS_ONCE(*pudp); pud = READ_ONCE(*pudp);
if (pud_none(pud)) if (pud_none(pud))
return NULL; return NULL;
...@@ -990,7 +990,7 @@ pte_t *find_linux_pte_or_hugepte(pgd_t *pgdir, unsigned long ea, unsigned *shift ...@@ -990,7 +990,7 @@ pte_t *find_linux_pte_or_hugepte(pgd_t *pgdir, unsigned long ea, unsigned *shift
else { else {
pdshift = PMD_SHIFT; pdshift = PMD_SHIFT;
pmdp = pmd_offset(&pud, ea); pmdp = pmd_offset(&pud, ea);
pmd = ACCESS_ONCE(*pmdp); pmd = READ_ONCE(*pmdp);
/* /*
* A hugepage collapse is captured by pmd_none, because * A hugepage collapse is captured by pmd_none, because
* it mark the pmd none and do a hpte invalidate. * it mark the pmd none and do a hpte invalidate.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册