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

From: "Aneesh Kumar K.V" <[email-masked]>
Date: Tue, 29 Jul 2014 16:07:32 +0530

Benjamin Herrenschmidt <[email-masked]> 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 set ? (In case it's
> in the middle of being updated).

The reace against withdraw is not a real problem. We use
get_hpte_slot_array in huge page invalidate and hash page. In the first
case we are holding pmd_trans_huge_lock and in the later we have the
_PAGE_BUSY check.

-aneesh