[lkml]   [2001]   [Jul]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH] free_one_pgd
Recently, in my arch (SuperH which uses two-level page table), I've
changed the function pgd_clear to zero-clear the entry. Then, we see
memory leak.

I think that pgd_clear in free_one_pgd should be placed _after_
calling free_one_pmd. Or else, free_one_pmd doesn't free anything.

This memory leak occurs when the architecture uses two-level page table
and non-null implementation of pgd_clear.

Index: mm/memory.c
RCS file: /cvsroot/linuxsh/kernel/mm/memory.c,v
retrieving revision 1.31
diff -u -p -r1.31 memory.c
--- mm/memory.c 2001/07/11 01:12:27 1.31
+++ mm/memory.c 2001/07/16 08:05:46
@@ -102,9 +102,9 @@ static inline void free_one_pgd(pgd_t *
pmd = pmd_offset(dir, 0);
- pgd_clear(dir);
for (j = 0; j < PTRS_PER_PMD ; j++)
+ pgd_clear(dir);

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at
 \ /
  Last update: 2005-03-22 12:57    [W:0.018 / U:0.528 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site