x86, mm: do not leak page->ptl for pmd page tables
authorKirill A. Shutemov <[email protected]>
Thu, 21 Nov 2013 22:32:09 +0000 (14:32 -0800)
committerLinus Torvalds <[email protected]>
Fri, 22 Nov 2013 00:42:28 +0000 (16:42 -0800)
commitc283610e44ec4ccc412dde8b71cf297ed9515f2f
treedd3c83db8dabefbeb3733cd428cced7c62602beb
parent3a72660b07d86d60457ca32080b1ce8c2b628ee2
x86, mm: do not leak page->ptl for pmd page tables

There are two code paths how page with pmd page table can be freed:
pmd_free() and pmd_free_tlb().

I've missed the second one and didn't add page table destructor call
there.  It leads to leak of page->ptl for pmd page tables, if
dynamically allocated page->ptl is in use.

The patch adds the missed destructor and modifies documentation
accordingly.

Signed-off-by: Kirill A. Shutemov <[email protected]>
Reported-by: Andrey Vagin <[email protected]>
Tested-by: Andrey Vagin <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Documentation/vm/split_page_table_lock
arch/x86/mm/pgtable.c