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

Subsystems: linux for powerpc (32-bit and 64-bit), the rest

STALE3297d

5 messages, 4 authors, 2017-07-27 · open the first message on its own page

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

From: Aneesh Kumar K.V <hidden>
Date: 2017-06-17 14:31:09

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

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

From: Ram Pai <hidden>
Date: 2017-06-17 16:00:40

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

Tested-by: Ram Pai <redacted>


On Sat, Jun 17, 2017 at 08:00:55PM +0530, Aneesh Kumar K.V wrote:
quoted hunk
Fixes: dad6f37c2602e ("powerpc: subpage_protect: Increase the array size to take care of 64TB")
Signed-off-by: Aneesh Kumar K.V <redacted>
---
 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

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

From: Anshuman Khandual <hidden>
Date: 2017-06-19 07:22:34

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 ?

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

From: Ram Pai <hidden>
Date: 2017-06-19 17:54:40

On Mon, Jun 19, 2017 at 12:52:14PM +0530, Anshuman Khandual wrote:
On 06/17/2017 09:30 PM, Ram Pai wrote:
quoted
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

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

From: Michael Ellerman <hidden>
Date: 2017-07-27 12:38:29

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 <redacted>
Tested-by: Ram Pai <redacted>
Applied to powerpc fixes, thanks.

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

cheers
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help