Re: [PATCH] powerpc: thp: Add write barrier after updating the valid bit

2014-07-29 Thread Aneesh Kumar K.V
Benjamin Herrenschmidt writes: > On Tue, 2014-07-29 at 12:25 +0530, Aneesh Kumar K.V wrote: >> We want to make sure for usage like below we don't reorder the load. >> >> if (pmd_trans_huge(*pmdp)){ >> >>get_hpte_slot_array(pmdp) >> } > > Shouldn't we also make sure that we don't have lock

Re: [PATCH] powerpc: thp: Add write barrier after updating the valid bit

2014-07-29 Thread Benjamin Herrenschmidt
On Tue, 2014-07-29 at 12:25 +0530, Aneesh Kumar K.V wrote: > We want to make sure for usage like below we don't reorder the load. > > if (pmd_trans_huge(*pmdp)){ > >get_hpte_slot_array(pmdp) > } Shouldn't we also make sure that we don't have lock set ? (In case it's in the middle of being u

Re: [PATCH] powerpc: thp: Add write barrier after updating the valid bit

2014-07-28 Thread Aneesh Kumar K.V
Benjamin Herrenschmidt writes: > On Wed, 2014-07-23 at 00:23 +0530, Aneesh Kumar K.V wrote: >> > A better place for this would be right before the last write to the PMD >> > (that's also clearing BUSY) in __hash_page_thp(). Basically, it's the >> > normal lock ordering that's missing here, nothin

Re: [PATCH] powerpc: thp: Add write barrier after updating the valid bit

2014-07-22 Thread Benjamin Herrenschmidt
On Wed, 2014-07-23 at 00:23 +0530, Aneesh Kumar K.V wrote: > > A better place for this would be right before the last write to the PMD > > (that's also clearing BUSY) in __hash_page_thp(). Basically, it's the > > normal lock ordering that's missing here, nothing specific to > > mark_hpte_slot_valid

Re: [PATCH] powerpc: thp: Add write barrier after updating the valid bit

2014-07-22 Thread Aneesh Kumar K.V
Benjamin Herrenschmidt writes: > On Tue, 2014-07-15 at 20:22 +0530, Aneesh Kumar K.V wrote: >> 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 that clearing pmd busy bit and updating

Re: [PATCH] powerpc: thp: Add write barrier after updating the valid bit

2014-07-21 Thread Benjamin Herrenschmidt
On Tue, 2014-07-15 at 20:22 +0530, Aneesh Kumar K.V wrote: > 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 that clearing pmd busy bit and updating > hpte valid info are ordered properly

[PATCH] powerpc: thp: Add write barrier after updating the valid bit

2014-07-15 Thread Aneesh Kumar K.V
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 that clearing pmd busy bit and updating hpte valid info are ordered properly. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/p

[PATCH] powerpc: thp: Add write barrier after updating the valid bit

2014-07-15 Thread Aneesh Kumar K.V
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 that clearing pmd busy bit and updating hpte valid info are ordered properly. Signed-off-by: Aneesh Kumar K.V --- arch/powerpc/include/asm/p