aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc
diff options
context:
space:
mode:
authorMel Gorman <mel@csn.ul.ie>2007-10-16 04:26:02 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-16 12:43:00 -0400
commit467c996c1e1910633fa8e7adc9b052aa3ed5f97c (patch)
tree09e0e70160386be1bdaa12801afddf287e12c8a1 /fs/proc
parentd9c2340052278d8eb2ffb16b0484f8f794def4de (diff)
Print out statistics in relation to fragmentation avoidance to /proc/pagetypeinfo
This patch provides fragmentation avoidance statistics via /proc/pagetypeinfo. The information is collected only on request so there is no runtime overhead. The statistics are in three parts: The first part prints information on the size of blocks that pages are being grouped on and looks like Page block order: 10 Pages per block: 1024 The second part is a more detailed version of /proc/buddyinfo and looks like Free pages count per migrate type at order 0 1 2 3 4 5 6 7 8 9 10 Node 0, zone DMA, type Unmovable 0 0 0 0 0 0 0 0 0 0 0 Node 0, zone DMA, type Reclaimable 1 0 0 0 0 0 0 0 0 0 0 Node 0, zone DMA, type Movable 0 0 0 0 0 0 0 0 0 0 0 Node 0, zone DMA, type Reserve 0 4 4 0 0 0 0 1 0 1 0 Node 0, zone Normal, type Unmovable 111 8 4 4 2 3 1 0 0 0 0 Node 0, zone Normal, type Reclaimable 293 89 8 0 0 0 0 0 0 0 0 Node 0, zone Normal, type Movable 1 6 13 9 7 6 3 0 0 0 0 Node 0, zone Normal, type Reserve 0 0 0 0 0 0 0 0 0 0 4 The third part looks like Number of blocks type Unmovable Reclaimable Movable Reserve Node 0, zone DMA 0 1 2 1 Node 0, zone Normal 3 17 94 4 To walk the zones within a node with interrupts disabled, walk_zones_in_node() is introduced and shared between /proc/buddyinfo, /proc/zoneinfo and /proc/pagetypeinfo to reduce code duplication. It seems specific to what vmstat.c requires but could be broken out as a general utility function in mmzone.c if there were other other potential users. Signed-off-by: Mel Gorman <mel@csn.ul.ie> Acked-by: Andy Whitcroft <apw@shadowen.org> Acked-by: Christoph Lameter <clameter@sgi.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/proc')
-rw-r--r--fs/proc/proc_misc.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/fs/proc/proc_misc.c b/fs/proc/proc_misc.c
index 0071939c0095..5de7f874d95c 100644
--- a/fs/proc/proc_misc.c
+++ b/fs/proc/proc_misc.c
@@ -229,6 +229,19 @@ static const struct file_operations fragmentation_file_operations = {
229 .release = seq_release, 229 .release = seq_release,
230}; 230};
231 231
232extern struct seq_operations pagetypeinfo_op;
233static int pagetypeinfo_open(struct inode *inode, struct file *file)
234{
235 return seq_open(file, &pagetypeinfo_op);
236}
237
238static const struct file_operations pagetypeinfo_file_ops = {
239 .open = pagetypeinfo_open,
240 .read = seq_read,
241 .llseek = seq_lseek,
242 .release = seq_release,
243};
244
232extern struct seq_operations zoneinfo_op; 245extern struct seq_operations zoneinfo_op;
233static int zoneinfo_open(struct inode *inode, struct file *file) 246static int zoneinfo_open(struct inode *inode, struct file *file)
234{ 247{
@@ -724,6 +737,7 @@ void __init proc_misc_init(void)
724#endif 737#endif
725#endif 738#endif
726 create_seq_entry("buddyinfo",S_IRUGO, &fragmentation_file_operations); 739 create_seq_entry("buddyinfo",S_IRUGO, &fragmentation_file_operations);
740 create_seq_entry("pagetypeinfo", S_IRUGO, &pagetypeinfo_file_ops);
727 create_seq_entry("vmstat",S_IRUGO, &proc_vmstat_file_operations); 741 create_seq_entry("vmstat",S_IRUGO, &proc_vmstat_file_operations);
728 create_seq_entry("zoneinfo",S_IRUGO, &proc_zoneinfo_file_operations); 742 create_seq_entry("zoneinfo",S_IRUGO, &proc_zoneinfo_file_operations);
729#ifdef CONFIG_BLOCK 743#ifdef CONFIG_BLOCK