diff options
-rw-r--r-- | include/linux/mm.h | 7 | ||||
-rw-r--r-- | mm/page_alloc.c | 8 |
2 files changed, 5 insertions, 10 deletions
diff --git a/include/linux/mm.h b/include/linux/mm.h index 26146623be2f..5a6068ff5556 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -1103,12 +1103,7 @@ static inline void vm_stat_account(struct mm_struct *mm, | |||
1103 | 1103 | ||
1104 | #ifndef CONFIG_DEBUG_PAGEALLOC | 1104 | #ifndef CONFIG_DEBUG_PAGEALLOC |
1105 | static inline void | 1105 | static inline void |
1106 | kernel_map_pages(struct page *page, int numpages, int enable) | 1106 | kernel_map_pages(struct page *page, int numpages, int enable) {} |
1107 | { | ||
1108 | if (!PageHighMem(page) && !enable) | ||
1109 | debug_check_no_locks_freed(page_address(page), | ||
1110 | numpages * PAGE_SIZE); | ||
1111 | } | ||
1112 | #endif | 1107 | #endif |
1113 | 1108 | ||
1114 | extern struct vm_area_struct *get_gate_vma(struct task_struct *tsk); | 1109 | extern struct vm_area_struct *get_gate_vma(struct task_struct *tsk); |
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index c5caac2c3c5a..40db96a655d0 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -495,15 +495,13 @@ static void __free_pages_ok(struct page *page, unsigned int order) | |||
495 | int i; | 495 | int i; |
496 | int reserved = 0; | 496 | int reserved = 0; |
497 | 497 | ||
498 | if (!PageHighMem(page)) | ||
499 | debug_check_no_locks_freed(page_address(page), | ||
500 | PAGE_SIZE<<order); | ||
501 | |||
502 | for (i = 0 ; i < (1 << order) ; ++i) | 498 | for (i = 0 ; i < (1 << order) ; ++i) |
503 | reserved += free_pages_check(page + i); | 499 | reserved += free_pages_check(page + i); |
504 | if (reserved) | 500 | if (reserved) |
505 | return; | 501 | return; |
506 | 502 | ||
503 | if (!PageHighMem(page)) | ||
504 | debug_check_no_locks_freed(page_address(page),PAGE_SIZE<<order); | ||
507 | arch_free_page(page, order); | 505 | arch_free_page(page, order); |
508 | kernel_map_pages(page, 1 << order, 0); | 506 | kernel_map_pages(page, 1 << order, 0); |
509 | 507 | ||
@@ -787,6 +785,8 @@ static void fastcall free_hot_cold_page(struct page *page, int cold) | |||
787 | if (free_pages_check(page)) | 785 | if (free_pages_check(page)) |
788 | return; | 786 | return; |
789 | 787 | ||
788 | if (!PageHighMem(page)) | ||
789 | debug_check_no_locks_freed(page_address(page), PAGE_SIZE); | ||
790 | arch_free_page(page, 0); | 790 | arch_free_page(page, 0); |
791 | kernel_map_pages(page, 1, 0); | 791 | kernel_map_pages(page, 1, 0); |
792 | 792 | ||