mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
[PATCH] mm: compound release fix
Compound pages on SMP systems can now often be freed from pagetables via the release_pages path. This uses put_page_testzero which does not handle compound pages at all. Releasing constituent pages from process mappings decrements their count to a large negative number and leaks the reference at the head page - net result is a memory leak. The problem was hidden because the debug check in put_page_testzero itself actually did take compound pages into consideration. Fix the bug and the debug check. Signed-off-by: Nick Piggin <npiggin@suse.de> Acked-by: Hugh Dickins <hugh@veritas.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
99f6d61bda
commit
8519fb30e4
2 changed files with 24 additions and 12 deletions
|
@ -303,7 +303,7 @@ struct page {
|
|||
*/
|
||||
#define put_page_testzero(p) \
|
||||
({ \
|
||||
BUG_ON(page_count(p) == 0); \
|
||||
BUG_ON(atomic_read(&(p)->_count) == -1);\
|
||||
atomic_add_negative(-1, &(p)->_count); \
|
||||
})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue