aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/mm/pageattr.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2008-04-17 11:40:45 -0400
committerIngo Molnar <mingo@elte.hu>2008-04-17 11:40:45 -0400
commitee7ae7a1981caaa4a5b14d8c75692a9dccd52105 (patch)
tree4ae562c268501ca6b0a1ec19d0aa43809d95581e /arch/x86/mm/pageattr.c
parent5de253cc5b1f565f7aeb5bacd67bac37e943ceef (diff)
x86: add debug info to DEBUG_PAGEALLOC
Add debug information for DEBUG_PAGEALLOC to get some statistics about the pool usage and split status. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/mm/pageattr.c')
-rw-r--r--arch/x86/mm/pageattr.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
index 7b79f6be4e7d..6cdfc0fd68be 100644
--- a/arch/x86/mm/pageattr.c
+++ b/arch/x86/mm/pageattr.c
@@ -9,6 +9,8 @@
9#include <linux/slab.h> 9#include <linux/slab.h>
10#include <linux/mm.h> 10#include <linux/mm.h>
11#include <linux/interrupt.h> 11#include <linux/interrupt.h>
12#include <linux/seq_file.h>
13#include <linux/debugfs.h>
12 14
13#include <asm/e820.h> 15#include <asm/e820.h>
14#include <asm/processor.h> 16#include <asm/processor.h>
@@ -918,6 +920,45 @@ void kernel_map_pages(struct page *page, int numpages, int enable)
918 cpa_fill_pool(NULL); 920 cpa_fill_pool(NULL);
919} 921}
920 922
923#ifdef CONFIG_DEBUG_FS
924static int dpa_show(struct seq_file *m, void *v)
925{
926 seq_puts(m, "DEBUG_PAGEALLOC\n");
927 seq_printf(m, "pool_size : %lu\n", pool_size);
928 seq_printf(m, "pool_pages : %lu\n", pool_pages);
929 seq_printf(m, "pool_low : %lu\n", pool_low);
930 seq_printf(m, "pool_used : %lu\n", pool_used);
931 seq_printf(m, "pool_failed : %lu\n", pool_failed);
932
933 return 0;
934}
935
936static int dpa_open(struct inode *inode, struct file *filp)
937{
938 return single_open(filp, dpa_show, NULL);
939}
940
941static const struct file_operations dpa_fops = {
942 .open = dpa_open,
943 .read = seq_read,
944 .llseek = seq_lseek,
945 .release = single_release,
946};
947
948int __init debug_pagealloc_proc_init(void)
949{
950 struct dentry *de;
951
952 de = debugfs_create_file("debug_pagealloc", 0600, NULL, NULL,
953 &dpa_fops);
954 if (!de)
955 return -ENOMEM;
956
957 return 0;
958}
959__initcall(debug_pagealloc_proc_init);
960#endif
961
921#ifdef CONFIG_HIBERNATION 962#ifdef CONFIG_HIBERNATION
922 963
923bool kernel_page_present(struct page *page) 964bool kernel_page_present(struct page *page)