aboutsummaryrefslogtreecommitdiffstats
path: root/mm/page_alloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/page_alloc.c')
-rw-r--r--mm/page_alloc.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 8896e874a67d..402a504f1228 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -19,6 +19,7 @@
19#include <linux/swap.h> 19#include <linux/swap.h>
20#include <linux/interrupt.h> 20#include <linux/interrupt.h>
21#include <linux/pagemap.h> 21#include <linux/pagemap.h>
22#include <linux/jiffies.h>
22#include <linux/bootmem.h> 23#include <linux/bootmem.h>
23#include <linux/compiler.h> 24#include <linux/compiler.h>
24#include <linux/kernel.h> 25#include <linux/kernel.h>
@@ -221,13 +222,19 @@ static inline int bad_range(struct zone *zone, struct page *page)
221 222
222static void bad_page(struct page *page) 223static void bad_page(struct page *page)
223{ 224{
224 printk(KERN_EMERG "Bad page state in process '%s'\n" 225 void *pc = page_get_page_cgroup(page);
225 KERN_EMERG "page:%p flags:0x%0*lx mapping:%p mapcount:%d count:%d\n" 226
226 KERN_EMERG "Trying to fix it up, but a reboot is needed\n" 227 printk(KERN_EMERG "Bad page state in process '%s'\n" KERN_EMERG
227 KERN_EMERG "Backtrace:\n", 228 "page:%p flags:0x%0*lx mapping:%p mapcount:%d count:%d\n",
228 current->comm, page, (int)(2*sizeof(unsigned long)), 229 current->comm, page, (int)(2*sizeof(unsigned long)),
229 (unsigned long)page->flags, page->mapping, 230 (unsigned long)page->flags, page->mapping,
230 page_mapcount(page), page_count(page)); 231 page_mapcount(page), page_count(page));
232 if (pc) {
233 printk(KERN_EMERG "cgroup:%p\n", pc);
234 page_reset_bad_cgroup(page);
235 }
236 printk(KERN_EMERG "Trying to fix it up, but a reboot is needed\n"
237 KERN_EMERG "Backtrace:\n");
231 dump_stack(); 238 dump_stack();
232 page->flags &= ~(1 << PG_lru | 239 page->flags &= ~(1 << PG_lru |
233 1 << PG_private | 240 1 << PG_private |
@@ -453,6 +460,7 @@ static inline int free_pages_check(struct page *page)
453{ 460{
454 if (unlikely(page_mapcount(page) | 461 if (unlikely(page_mapcount(page) |
455 (page->mapping != NULL) | 462 (page->mapping != NULL) |
463 (page_get_page_cgroup(page) != NULL) |
456 (page_count(page) != 0) | 464 (page_count(page) != 0) |
457 (page->flags & ( 465 (page->flags & (
458 1 << PG_lru | 466 1 << PG_lru |
@@ -602,6 +610,7 @@ static int prep_new_page(struct page *page, int order, gfp_t gfp_flags)
602{ 610{
603 if (unlikely(page_mapcount(page) | 611 if (unlikely(page_mapcount(page) |
604 (page->mapping != NULL) | 612 (page->mapping != NULL) |
613 (page_get_page_cgroup(page) != NULL) |
605 (page_count(page) != 0) | 614 (page_count(page) != 0) |
606 (page->flags & ( 615 (page->flags & (
607 1 << PG_lru | 616 1 << PG_lru |
@@ -988,7 +997,6 @@ static void free_hot_cold_page(struct page *page, int cold)
988 997
989 if (!PageHighMem(page)) 998 if (!PageHighMem(page))
990 debug_check_no_locks_freed(page_address(page), PAGE_SIZE); 999 debug_check_no_locks_freed(page_address(page), PAGE_SIZE);
991 VM_BUG_ON(page_get_page_cgroup(page));
992 arch_free_page(page, 0); 1000 arch_free_page(page, 0);
993 kernel_map_pages(page, 1, 0); 1001 kernel_map_pages(page, 1, 0);
994 1002
@@ -1276,7 +1284,7 @@ static nodemask_t *zlc_setup(struct zonelist *zonelist, int alloc_flags)
1276 if (!zlc) 1284 if (!zlc)
1277 return NULL; 1285 return NULL;
1278 1286
1279 if (jiffies - zlc->last_full_zap > 1 * HZ) { 1287 if (time_after(jiffies, zlc->last_full_zap + HZ)) {
1280 bitmap_zero(zlc->fullzones, MAX_ZONES_PER_ZONELIST); 1288 bitmap_zero(zlc->fullzones, MAX_ZONES_PER_ZONELIST);
1281 zlc->last_full_zap = jiffies; 1289 zlc->last_full_zap = jiffies;
1282 } 1290 }
@@ -2527,7 +2535,6 @@ void __meminit memmap_init_zone(unsigned long size, int nid, unsigned long zone,
2527 set_page_links(page, zone, nid, pfn); 2535 set_page_links(page, zone, nid, pfn);
2528 init_page_count(page); 2536 init_page_count(page);
2529 reset_page_mapcount(page); 2537 reset_page_mapcount(page);
2530 page_assign_page_cgroup(page, NULL);
2531 SetPageReserved(page); 2538 SetPageReserved(page);
2532 2539
2533 /* 2540 /*