diff options
Diffstat (limited to 'mm/vmalloc.c')
-rw-r--r-- | mm/vmalloc.c | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 830a5580c5d7..bba06c41fc59 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c | |||
@@ -388,16 +388,14 @@ static void __vunmap(const void *addr, int deallocate_pages) | |||
388 | return; | 388 | return; |
389 | 389 | ||
390 | if ((PAGE_SIZE-1) & (unsigned long)addr) { | 390 | if ((PAGE_SIZE-1) & (unsigned long)addr) { |
391 | printk(KERN_ERR "Trying to vfree() bad address (%p)\n", addr); | 391 | WARN(1, KERN_ERR "Trying to vfree() bad address (%p)\n", addr); |
392 | WARN_ON(1); | ||
393 | return; | 392 | return; |
394 | } | 393 | } |
395 | 394 | ||
396 | area = remove_vm_area(addr); | 395 | area = remove_vm_area(addr); |
397 | if (unlikely(!area)) { | 396 | if (unlikely(!area)) { |
398 | printk(KERN_ERR "Trying to vfree() nonexistent vm area (%p)\n", | 397 | WARN(1, KERN_ERR "Trying to vfree() nonexistent vm area (%p)\n", |
399 | addr); | 398 | addr); |
400 | WARN_ON(1); | ||
401 | return; | 399 | return; |
402 | } | 400 | } |
403 | 401 | ||
@@ -938,6 +936,25 @@ static void s_stop(struct seq_file *m, void *p) | |||
938 | read_unlock(&vmlist_lock); | 936 | read_unlock(&vmlist_lock); |
939 | } | 937 | } |
940 | 938 | ||
939 | static void show_numa_info(struct seq_file *m, struct vm_struct *v) | ||
940 | { | ||
941 | if (NUMA_BUILD) { | ||
942 | unsigned int nr, *counters = m->private; | ||
943 | |||
944 | if (!counters) | ||
945 | return; | ||
946 | |||
947 | memset(counters, 0, nr_node_ids * sizeof(unsigned int)); | ||
948 | |||
949 | for (nr = 0; nr < v->nr_pages; nr++) | ||
950 | counters[page_to_nid(v->pages[nr])]++; | ||
951 | |||
952 | for_each_node_state(nr, N_HIGH_MEMORY) | ||
953 | if (counters[nr]) | ||
954 | seq_printf(m, " N%u=%u", nr, counters[nr]); | ||
955 | } | ||
956 | } | ||
957 | |||
941 | static int s_show(struct seq_file *m, void *p) | 958 | static int s_show(struct seq_file *m, void *p) |
942 | { | 959 | { |
943 | struct vm_struct *v = p; | 960 | struct vm_struct *v = p; |
@@ -974,6 +991,7 @@ static int s_show(struct seq_file *m, void *p) | |||
974 | if (v->flags & VM_VPAGES) | 991 | if (v->flags & VM_VPAGES) |
975 | seq_printf(m, " vpages"); | 992 | seq_printf(m, " vpages"); |
976 | 993 | ||
994 | show_numa_info(m, v); | ||
977 | seq_putc(m, '\n'); | 995 | seq_putc(m, '\n'); |
978 | return 0; | 996 | return 0; |
979 | } | 997 | } |