Skip to content

Commit 028725e

Browse files
Liu Shixinakpm00
authored andcommitted
bootmem: remove the vmemmap pages from kmemleak in free_bootmem_page
commit dd0ff4d ("bootmem: remove the vmemmap pages from kmemleak in put_page_bootmem") fix an overlaps existing problem of kmemleak. But the problem still existed when HAVE_BOOTMEM_INFO_NODE is disabled, because in this case, free_bootmem_page() will call free_reserved_page() directly. Fix the problem by adding kmemleak_free_part() in free_bootmem_page() when HAVE_BOOTMEM_INFO_NODE is disabled. Link: https://lkml.kernel.org/r/[email protected] Fixes: f41f2ed ("mm: hugetlb: free the vmemmap pages associated with each HugeTLB page") Signed-off-by: Liu Shixin <[email protected]> Acked-by: Muchun Song <[email protected]> Cc: Matthew Wilcox <[email protected]> Cc: Mike Kravetz <[email protected]> Cc: Oscar Salvador <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 0d707cd commit 028725e

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

include/linux/bootmem_info.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
#define __LINUX_BOOTMEM_INFO_H
44

55
#include <linux/mm.h>
6+
#include <linux/kmemleak.h>
67

78
/*
89
* Types for free bootmem stored in page->lru.next. These have to be in
@@ -59,6 +60,7 @@ static inline void get_page_bootmem(unsigned long info, struct page *page,
5960

6061
static inline void free_bootmem_page(struct page *page)
6162
{
63+
kmemleak_free_part(page_to_virt(page), PAGE_SIZE);
6264
free_reserved_page(page);
6365
}
6466
#endif

0 commit comments

Comments
 (0)