linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/mm/hash: Free the subpage_prot_table correctly
@ 2017-06-17 14:30 Aneesh Kumar K.V
  2017-06-17 16:00 ` Ram Pai
  2017-07-27 12:38 ` powerpc/mm/hash: Free the subpage_prot_table correctly Michael Ellerman
  0 siblings, 2 replies; 5+ messages in thread
From: Aneesh Kumar K.V @ 2017-06-17 14:30 UTC (permalink / raw)
  To: benh, paulus, mpe, Ram Pai; +Cc: linuxppc-dev, Aneesh Kumar K.V

Fixes: dad6f37c2602e ("powerpc: subpage_protect: Increase the array size to take care of 64TB")
Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
---
 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

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] powerpc/mm/hash: Free the subpage_prot_table correctly
  2017-06-17 14:30 [PATCH] powerpc/mm/hash: Free the subpage_prot_table correctly Aneesh Kumar K.V
@ 2017-06-17 16:00 ` Ram Pai
  2017-06-19  7:22   ` Anshuman Khandual
  2017-07-27 12:38 ` powerpc/mm/hash: Free the subpage_prot_table correctly Michael Ellerman
  1 sibling, 1 reply; 5+ messages in thread
From: Ram Pai @ 2017-06-17 16:00 UTC (permalink / raw)
  To: Aneesh Kumar K.V; +Cc: benh, paulus, mpe, linuxppc-dev


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

Tested-by: Ram Pai <linuxram@us.ibm.com>


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 <aneesh.kumar@linux.vnet.ibm.com>
> ---
>  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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] powerpc/mm/hash: Free the subpage_prot_table correctly
  2017-06-17 16:00 ` Ram Pai
@ 2017-06-19  7:22   ` Anshuman Khandual
  2017-06-19 17:54     ` [PATCH] powerpc/mm/hash: Free the subpage_prot_table correctlyy Ram Pai
  0 siblings, 1 reply; 5+ messages in thread
From: Anshuman Khandual @ 2017-06-19  7:22 UTC (permalink / raw)
  To: Ram Pai, Aneesh Kumar K.V; +Cc: paulus, linuxppc-dev

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 ?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] powerpc/mm/hash: Free the subpage_prot_table correctlyy
  2017-06-19  7:22   ` Anshuman Khandual
@ 2017-06-19 17:54     ` Ram Pai
  0 siblings, 0 replies; 5+ messages in thread
From: Ram Pai @ 2017-06-19 17:54 UTC (permalink / raw)
  To: Anshuman Khandual; +Cc: Aneesh Kumar K.V, paulus, linuxppc-dev

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: powerpc/mm/hash: Free the subpage_prot_table correctly
  2017-06-17 14:30 [PATCH] powerpc/mm/hash: Free the subpage_prot_table correctly Aneesh Kumar K.V
  2017-06-17 16:00 ` Ram Pai
@ 2017-07-27 12:38 ` Michael Ellerman
  1 sibling, 0 replies; 5+ messages in thread
From: Michael Ellerman @ 2017-07-27 12:38 UTC (permalink / raw)
  To: Aneesh Kumar K.V, benh, paulus, Ram Pai; +Cc: linuxppc-dev, Aneesh Kumar K.V

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 <aneesh.kumar@linux.vnet.ibm.com>
> Tested-by: Ram Pai <linuxram@us.ibm.com>

Applied to powerpc fixes, thanks.

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

cheers

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2017-07-27 12:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-17 14:30 [PATCH] powerpc/mm/hash: Free the subpage_prot_table correctly Aneesh Kumar K.V
2017-06-17 16:00 ` Ram Pai
2017-06-19  7:22   ` Anshuman Khandual
2017-06-19 17:54     ` [PATCH] powerpc/mm/hash: Free the subpage_prot_table correctlyy Ram Pai
2017-07-27 12:38 ` powerpc/mm/hash: Free the subpage_prot_table correctly Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).