diff options
Diffstat (limited to 'mm/mmap.c')
-rw-r--r-- | mm/mmap.c | 21 |
1 files changed, 12 insertions, 9 deletions
@@ -6,6 +6,8 @@ | |||
6 | * Address space accounting code <alan@lxorguk.ukuu.org.uk> | 6 | * Address space accounting code <alan@lxorguk.ukuu.org.uk> |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
10 | |||
9 | #include <linux/kernel.h> | 11 | #include <linux/kernel.h> |
10 | #include <linux/slab.h> | 12 | #include <linux/slab.h> |
11 | #include <linux/backing-dev.h> | 13 | #include <linux/backing-dev.h> |
@@ -37,6 +39,7 @@ | |||
37 | #include <linux/sched/sysctl.h> | 39 | #include <linux/sched/sysctl.h> |
38 | #include <linux/notifier.h> | 40 | #include <linux/notifier.h> |
39 | #include <linux/memory.h> | 41 | #include <linux/memory.h> |
42 | #include <linux/printk.h> | ||
40 | 43 | ||
41 | #include <asm/uaccess.h> | 44 | #include <asm/uaccess.h> |
42 | #include <asm/cacheflush.h> | 45 | #include <asm/cacheflush.h> |
@@ -361,20 +364,20 @@ static int browse_rb(struct rb_root *root) | |||
361 | struct vm_area_struct *vma; | 364 | struct vm_area_struct *vma; |
362 | vma = rb_entry(nd, struct vm_area_struct, vm_rb); | 365 | vma = rb_entry(nd, struct vm_area_struct, vm_rb); |
363 | if (vma->vm_start < prev) { | 366 | if (vma->vm_start < prev) { |
364 | printk("vm_start %lx prev %lx\n", vma->vm_start, prev); | 367 | pr_info("vm_start %lx prev %lx\n", vma->vm_start, prev); |
365 | bug = 1; | 368 | bug = 1; |
366 | } | 369 | } |
367 | if (vma->vm_start < pend) { | 370 | if (vma->vm_start < pend) { |
368 | printk("vm_start %lx pend %lx\n", vma->vm_start, pend); | 371 | pr_info("vm_start %lx pend %lx\n", vma->vm_start, pend); |
369 | bug = 1; | 372 | bug = 1; |
370 | } | 373 | } |
371 | if (vma->vm_start > vma->vm_end) { | 374 | if (vma->vm_start > vma->vm_end) { |
372 | printk("vm_end %lx < vm_start %lx\n", | 375 | pr_info("vm_end %lx < vm_start %lx\n", |
373 | vma->vm_end, vma->vm_start); | 376 | vma->vm_end, vma->vm_start); |
374 | bug = 1; | 377 | bug = 1; |
375 | } | 378 | } |
376 | if (vma->rb_subtree_gap != vma_compute_subtree_gap(vma)) { | 379 | if (vma->rb_subtree_gap != vma_compute_subtree_gap(vma)) { |
377 | printk("free gap %lx, correct %lx\n", | 380 | pr_info("free gap %lx, correct %lx\n", |
378 | vma->rb_subtree_gap, | 381 | vma->rb_subtree_gap, |
379 | vma_compute_subtree_gap(vma)); | 382 | vma_compute_subtree_gap(vma)); |
380 | bug = 1; | 383 | bug = 1; |
@@ -388,7 +391,7 @@ static int browse_rb(struct rb_root *root) | |||
388 | for (nd = pn; nd; nd = rb_prev(nd)) | 391 | for (nd = pn; nd; nd = rb_prev(nd)) |
389 | j++; | 392 | j++; |
390 | if (i != j) { | 393 | if (i != j) { |
391 | printk("backwards %d, forwards %d\n", j, i); | 394 | pr_info("backwards %d, forwards %d\n", j, i); |
392 | bug = 1; | 395 | bug = 1; |
393 | } | 396 | } |
394 | return bug ? -1 : i; | 397 | return bug ? -1 : i; |
@@ -423,17 +426,17 @@ static void validate_mm(struct mm_struct *mm) | |||
423 | i++; | 426 | i++; |
424 | } | 427 | } |
425 | if (i != mm->map_count) { | 428 | if (i != mm->map_count) { |
426 | printk("map_count %d vm_next %d\n", mm->map_count, i); | 429 | pr_info("map_count %d vm_next %d\n", mm->map_count, i); |
427 | bug = 1; | 430 | bug = 1; |
428 | } | 431 | } |
429 | if (highest_address != mm->highest_vm_end) { | 432 | if (highest_address != mm->highest_vm_end) { |
430 | printk("mm->highest_vm_end %lx, found %lx\n", | 433 | pr_info("mm->highest_vm_end %lx, found %lx\n", |
431 | mm->highest_vm_end, highest_address); | 434 | mm->highest_vm_end, highest_address); |
432 | bug = 1; | 435 | bug = 1; |
433 | } | 436 | } |
434 | i = browse_rb(&mm->mm_rb); | 437 | i = browse_rb(&mm->mm_rb); |
435 | if (i != mm->map_count) { | 438 | if (i != mm->map_count) { |
436 | printk("map_count %d rb %d\n", mm->map_count, i); | 439 | pr_info("map_count %d rb %d\n", mm->map_count, i); |
437 | bug = 1; | 440 | bug = 1; |
438 | } | 441 | } |
439 | BUG_ON(bug); | 442 | BUG_ON(bug); |
@@ -3280,7 +3283,7 @@ static struct notifier_block reserve_mem_nb = { | |||
3280 | static int __meminit init_reserve_notifier(void) | 3283 | static int __meminit init_reserve_notifier(void) |
3281 | { | 3284 | { |
3282 | if (register_hotmemory_notifier(&reserve_mem_nb)) | 3285 | if (register_hotmemory_notifier(&reserve_mem_nb)) |
3283 | printk("Failed registering memory add/remove notifier for admin reserve"); | 3286 | pr_err("Failed registering memory add/remove notifier for admin reserve\n"); |
3284 | 3287 | ||
3285 | return 0; | 3288 | return 0; |
3286 | } | 3289 | } |