[PATCH] powerpc/mm/hash: Free the subpage_prot_table correctly

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] powerpc/mm/hash: Free the subpage_prot_table correctly

Aneesh Kumar K.V-3
Fixes: dad6f37c2602e ("powerpc: subpage_protect: Increase the array size to take care of 64TB")
Signed-off-by: Aneesh Kumar K.V <[hidden email]>
---
 arch/powerpc/mm/subpage-prot.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/mm/subpage-prot.c b/arch/powerpc/mm/subpage-prot.c
index e94fbd4c8845..781532d7bc4d 100644
--- a/arch/powerpc/mm/subpage-prot.c
+++ b/arch/powerpc/mm/subpage-prot.c
@@ -36,7 +36,7 @@ void subpage_prot_free(struct mm_struct *mm)
  }
  }
  addr = 0;
- for (i = 0; i < 2; ++i) {
+ for (i = 0; i < (TASK_SIZE_USER64 >> 43); ++i) {
  p = spt->protptrs[i];
  if (!p)
  continue;
--
2.7.4

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] powerpc/mm/hash: Free the subpage_prot_table correctly

Ram Pai

This fix, resolved the OOM seen while running subpage_prot selftest, in a
infinite loop.

Tested-by: Ram Pai <[hidden email]>


On Sat, Jun 17, 2017 at 08:00:55PM +0530, Aneesh Kumar K.V wrote:

> Fixes: dad6f37c2602e ("powerpc: subpage_protect: Increase the array size to take care of 64TB")
> Signed-off-by: Aneesh Kumar K.V <[hidden email]>
> ---
>  arch/powerpc/mm/subpage-prot.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/mm/subpage-prot.c b/arch/powerpc/mm/subpage-prot.c
> index e94fbd4c8845..781532d7bc4d 100644
> --- a/arch/powerpc/mm/subpage-prot.c
> +++ b/arch/powerpc/mm/subpage-prot.c
> @@ -36,7 +36,7 @@ void subpage_prot_free(struct mm_struct *mm)
>   }
>   }
>   addr = 0;
> - for (i = 0; i < 2; ++i) {
> + for (i = 0; i < (TASK_SIZE_USER64 >> 43); ++i) {
>   p = spt->protptrs[i];
>   if (!p)
>   continue;
> --
> 2.7.4

--
Ram Pai

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] powerpc/mm/hash: Free the subpage_prot_table correctly

Anshuman Khandual
On 06/17/2017 09:30 PM, Ram Pai wrote:
>
> This fix, resolved the OOM seen while running subpage_prot selftest, in a
> infinite loop.

The OOM is caused because of memory leaks by wrong freeing
of the subpage_prot_table previously ?

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] powerpc/mm/hash: Free the subpage_prot_table correctlyy

Ram Pai
On Mon, Jun 19, 2017 at 12:52:14PM +0530, Anshuman Khandual wrote:
> On 06/17/2017 09:30 PM, Ram Pai wrote:
> >
> > This fix, resolved the OOM seen while running subpage_prot selftest, in a
> > infinite loop.
>
> The OOM is caused because of memory leaks by wrong freeing
> of the subpage_prot_table previously ?

No. Rather, not freeing up of the memory allocated previously
and tracked through the subpage_prot_table.

RP

Reply | Threaded
Open this post in threaded view
|

Re: powerpc/mm/hash: Free the subpage_prot_table correctly

Michael Ellerman-3
In reply to this post by Aneesh Kumar K.V-3
On Sat, 2017-06-17 at 14:30:55 UTC, "Aneesh Kumar K.V" wrote:
> Fixes: dad6f37c2602e ("powerpc: subpage_protect: Increase the array size to take care of 64TB")
> Signed-off-by: Aneesh Kumar K.V <[hidden email]>
> Tested-by: Ram Pai <[hidden email]>

Applied to powerpc fixes, thanks.

https://git.kernel.org/powerpc/c/0da12a7a81f1e2255e89dc783c565e

cheers