diff options
-rw-r--r-- | mm/backing-dev.c | 38 |
1 files changed, 34 insertions, 4 deletions
diff --git a/mm/backing-dev.c b/mm/backing-dev.c index 7f3fa79f25c0..22c45e932e3a 100644 --- a/mm/backing-dev.c +++ b/mm/backing-dev.c | |||
@@ -52,9 +52,29 @@ static void bdi_debug_init(void) | |||
52 | static int bdi_debug_stats_show(struct seq_file *m, void *v) | 52 | static int bdi_debug_stats_show(struct seq_file *m, void *v) |
53 | { | 53 | { |
54 | struct backing_dev_info *bdi = m->private; | 54 | struct backing_dev_info *bdi = m->private; |
55 | struct bdi_writeback *wb; | ||
55 | unsigned long background_thresh; | 56 | unsigned long background_thresh; |
56 | unsigned long dirty_thresh; | 57 | unsigned long dirty_thresh; |
57 | unsigned long bdi_thresh; | 58 | unsigned long bdi_thresh; |
59 | unsigned long nr_dirty, nr_io, nr_more_io, nr_wb; | ||
60 | struct inode *inode; | ||
61 | |||
62 | /* | ||
63 | * inode lock is enough here, the bdi->wb_list is protected by | ||
64 | * RCU on the reader side | ||
65 | */ | ||
66 | nr_wb = nr_dirty = nr_io = nr_more_io = 0; | ||
67 | spin_lock(&inode_lock); | ||
68 | list_for_each_entry(wb, &bdi->wb_list, list) { | ||
69 | nr_wb++; | ||
70 | list_for_each_entry(inode, &wb->b_dirty, i_list) | ||
71 | nr_dirty++; | ||
72 | list_for_each_entry(inode, &wb->b_io, i_list) | ||
73 | nr_io++; | ||
74 | list_for_each_entry(inode, &wb->b_more_io, i_list) | ||
75 | nr_more_io++; | ||
76 | } | ||
77 | spin_unlock(&inode_lock); | ||
58 | 78 | ||
59 | get_dirty_limits(&background_thresh, &dirty_thresh, &bdi_thresh, bdi); | 79 | get_dirty_limits(&background_thresh, &dirty_thresh, &bdi_thresh, bdi); |
60 | 80 | ||
@@ -64,12 +84,22 @@ static int bdi_debug_stats_show(struct seq_file *m, void *v) | |||
64 | "BdiReclaimable: %8lu kB\n" | 84 | "BdiReclaimable: %8lu kB\n" |
65 | "BdiDirtyThresh: %8lu kB\n" | 85 | "BdiDirtyThresh: %8lu kB\n" |
66 | "DirtyThresh: %8lu kB\n" | 86 | "DirtyThresh: %8lu kB\n" |
67 | "BackgroundThresh: %8lu kB\n", | 87 | "BackgroundThresh: %8lu kB\n" |
88 | "WriteBack threads:%8lu\n" | ||
89 | "b_dirty: %8lu\n" | ||
90 | "b_io: %8lu\n" | ||
91 | "b_more_io: %8lu\n" | ||
92 | "bdi_list: %8u\n" | ||
93 | "state: %8lx\n" | ||
94 | "wb_mask: %8lx\n" | ||
95 | "wb_list: %8u\n" | ||
96 | "wb_cnt: %8u\n", | ||
68 | (unsigned long) K(bdi_stat(bdi, BDI_WRITEBACK)), | 97 | (unsigned long) K(bdi_stat(bdi, BDI_WRITEBACK)), |
69 | (unsigned long) K(bdi_stat(bdi, BDI_RECLAIMABLE)), | 98 | (unsigned long) K(bdi_stat(bdi, BDI_RECLAIMABLE)), |
70 | K(bdi_thresh), | 99 | K(bdi_thresh), K(dirty_thresh), |
71 | K(dirty_thresh), | 100 | K(background_thresh), nr_wb, nr_dirty, nr_io, nr_more_io, |
72 | K(background_thresh)); | 101 | !list_empty(&bdi->bdi_list), bdi->state, bdi->wb_mask, |
102 | !list_empty(&bdi->wb_list), bdi->wb_cnt); | ||
73 | #undef K | 103 | #undef K |
74 | 104 | ||
75 | return 0; | 105 | return 0; |