Subject: Re: [PATCH V2] powerpc: thp: Fix crash on mremap

From: Benjamin Herrenschmidt <[email-masked]>
Date: Sat, 15 Feb 2014 08:34:19 +1100

On Thu, 2014-02-13 at 08:03 +1100, Benjamin Herrenschmidt wrote:

> It looks very different because the function that needs to be fixed
> changed a lot upstream in 3.13.

 .../...

Hi Greg !

You didn't say if that explanation was to your liking :-)

If it is, do you want Aneesh to re-submit the patch with such an
explanation in the changelog ?

Cheers,
Ben.

> In practice it's *not* very different in behaviour. It's just that
> on powerpc we need to unconditionally call withdraw and deposit when
> moving PTEs or it will crash, due to how we keep the transparent
> huge page in sync with the hash table.
> 
> With the 3.13 code, due to lock breaking introduced by Kirill in
> 3.13-rc's, there's already a generic case for doing that (if we dropped
> the lock). So we just changed the condition to essentially force the
> condition to true to always do it under control of an arch helper.
> 
> The pre-3.13 code didn't do the withdraw and deposit at all in that
> function however, so in that case, the patch (this 3.12 one) basically
> just adds the calls to withdraw and deposit under control of an ifdef
> which is only enabled for powerpc64.
> 
> So you are taking 0 risk with other architecture and as the powerpc
> maintainer I'm happy with the patch.
> 
> Cheers,
> Ben.
> 
>