diff options
author | Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> | 2014-08-13 03:01:57 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2014-08-13 04:20:37 -0400 |
commit | b0aa44a3dfae3d8f45bd1264349aa87f87b7774f (patch) | |
tree | 92b61ca0ea8b8cbd4ec4c9934aafa39eab29fd4d /arch/powerpc | |
parent | 2fabf084b6ad6337675d700b159a6091023544f2 (diff) |
powerpc/thp: Add write barrier after updating the valid bit
With hugepages, we store the hpte valid information in the pte page
whose address is stored in the second half of the PMD. Use a
write barrier to make sure clearing pmd busy bit and updating
hpte valid info are ordered properly.
CC: <stable@vger.kernel.org>
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/mm/hugepage-hash64.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/arch/powerpc/mm/hugepage-hash64.c b/arch/powerpc/mm/hugepage-hash64.c index 826893fcb3a7..11f9a37ca2c6 100644 --- a/arch/powerpc/mm/hugepage-hash64.c +++ b/arch/powerpc/mm/hugepage-hash64.c | |||
@@ -172,8 +172,11 @@ repeat: | |||
172 | mark_hpte_slot_valid(hpte_slot_array, index, slot); | 172 | mark_hpte_slot_valid(hpte_slot_array, index, slot); |
173 | } | 173 | } |
174 | /* | 174 | /* |
175 | * No need to use ldarx/stdcx here | 175 | * The hpte valid is stored in the pgtable whose address is in the |
176 | * second half of the PMD. Order this against clearing of the busy bit in | ||
177 | * huge pmd. | ||
176 | */ | 178 | */ |
179 | smp_wmb(); | ||
177 | *pmdp = __pmd(new_pmd & ~_PAGE_BUSY); | 180 | *pmdp = __pmd(new_pmd & ~_PAGE_BUSY); |
178 | return 0; | 181 | return 0; |
179 | } | 182 | } |