Subject: Re: [PATCH 1/2] powerpc: use smp_rmb when looking at deposisted pgtable to store hash index

From: "Aneesh Kumar K.V" <[email-masked]>
Date: Mon, 20 May 2013 14:56:18 +0530

Benjamin Herrenschmidt <[email-masked]> writes:

> On Mon, 2013-05-20 at 09:57 +0530, Aneesh Kumar K.V wrote:
>> Michael Neuling <[email-masked]> writes:
>> 
>> > Aneesh Kumar K.V <[email-masked]> wrote:
>> >
>> >> From: "Aneesh Kumar K.V" <[email-masked]>
>> >> 
>> >> We need to use smb_rmb when looking at hpte slot array. Otherwise we could
>> >> reorder the hpte_slot array load bfore even we marked the pmd trans huge.
>> >
>> > Does this need to go back into the stable series?
>> >
>> 
>> No the changes are not yet upstream. hpte_slot_array changes are in the
>> THP series. I didn't want to post the entire series again with the 
>> above two patches. 
>
> Note that any patch that adds such a rmb should have a very clear
> description of what is the corresponding wmb. It's almost never right to
> have one without the other. IE. What is it that you are ordering
> against.

Will update the commit message. Some of that smb_wmb() are in the
core THP, and the others in ppc64 code. Will update with more info.

When we deposit pgtable we use pgtable_trans_huge_deposit that calls
related smb_wmb(). When we read pgtable via pgtable_trans_huge_withdraw,
core THP code does the related smb_wmb() after setting the right
PTE information in the pgtable.

-aneesh