diff options
author | Wu Fengguang <fengguang.wu@intel.com> | 2011-05-04 21:54:37 -0400 |
---|---|---|
committer | Wu Fengguang <fengguang.wu@intel.com> | 2011-07-10 01:09:01 -0400 |
commit | d46db3d58233be4be980eb1e42eebe7808bcabab (patch) | |
tree | 6d813b33938d915f0c0633e8615d1ffdcc554c96 /include/trace/events/writeback.h | |
parent | 36715cef0770b7e2547892b7c3197fc024274630 (diff) |
writeback: make writeback_control.nr_to_write straight
Pass struct wb_writeback_work all the way down to writeback_sb_inodes(),
and initialize the struct writeback_control there.
struct writeback_control is basically designed to control writeback of a
single file, but we keep abuse it for writing multiple files in
writeback_sb_inodes() and its callers.
It immediately clean things up, e.g. suddenly wbc.nr_to_write vs
work->nr_pages starts to make sense, and instead of saving and restoring
pages_skipped in writeback_sb_inodes it can always start with a clean
zero value.
It also makes a neat IO pattern change: large dirty files are now
written in the full 4MB writeback chunk size, rather than whatever
remained quota in wbc->nr_to_write.
Acked-by: Jan Kara <jack@suse.cz>
Proposed-by: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Diffstat (limited to 'include/trace/events/writeback.h')
-rw-r--r-- | include/trace/events/writeback.h | 39 |
1 files changed, 28 insertions, 11 deletions
diff --git a/include/trace/events/writeback.h b/include/trace/events/writeback.h index 205d14919ef2..3e7662a0cfa3 100644 --- a/include/trace/events/writeback.h +++ b/include/trace/events/writeback.h | |||
@@ -62,6 +62,9 @@ DEFINE_EVENT(writeback_work_class, name, \ | |||
62 | DEFINE_WRITEBACK_WORK_EVENT(writeback_nothread); | 62 | DEFINE_WRITEBACK_WORK_EVENT(writeback_nothread); |
63 | DEFINE_WRITEBACK_WORK_EVENT(writeback_queue); | 63 | DEFINE_WRITEBACK_WORK_EVENT(writeback_queue); |
64 | DEFINE_WRITEBACK_WORK_EVENT(writeback_exec); | 64 | DEFINE_WRITEBACK_WORK_EVENT(writeback_exec); |
65 | DEFINE_WRITEBACK_WORK_EVENT(writeback_start); | ||
66 | DEFINE_WRITEBACK_WORK_EVENT(writeback_written); | ||
67 | DEFINE_WRITEBACK_WORK_EVENT(writeback_wait); | ||
65 | 68 | ||
66 | TRACE_EVENT(writeback_pages_written, | 69 | TRACE_EVENT(writeback_pages_written, |
67 | TP_PROTO(long pages_written), | 70 | TP_PROTO(long pages_written), |
@@ -101,6 +104,30 @@ DEFINE_WRITEBACK_EVENT(writeback_bdi_register); | |||
101 | DEFINE_WRITEBACK_EVENT(writeback_bdi_unregister); | 104 | DEFINE_WRITEBACK_EVENT(writeback_bdi_unregister); |
102 | DEFINE_WRITEBACK_EVENT(writeback_thread_start); | 105 | DEFINE_WRITEBACK_EVENT(writeback_thread_start); |
103 | DEFINE_WRITEBACK_EVENT(writeback_thread_stop); | 106 | DEFINE_WRITEBACK_EVENT(writeback_thread_stop); |
107 | DEFINE_WRITEBACK_EVENT(balance_dirty_start); | ||
108 | DEFINE_WRITEBACK_EVENT(balance_dirty_wait); | ||
109 | |||
110 | TRACE_EVENT(balance_dirty_written, | ||
111 | |||
112 | TP_PROTO(struct backing_dev_info *bdi, int written), | ||
113 | |||
114 | TP_ARGS(bdi, written), | ||
115 | |||
116 | TP_STRUCT__entry( | ||
117 | __array(char, name, 32) | ||
118 | __field(int, written) | ||
119 | ), | ||
120 | |||
121 | TP_fast_assign( | ||
122 | strncpy(__entry->name, dev_name(bdi->dev), 32); | ||
123 | __entry->written = written; | ||
124 | ), | ||
125 | |||
126 | TP_printk("bdi %s written %d", | ||
127 | __entry->name, | ||
128 | __entry->written | ||
129 | ) | ||
130 | ); | ||
104 | 131 | ||
105 | DECLARE_EVENT_CLASS(wbc_class, | 132 | DECLARE_EVENT_CLASS(wbc_class, |
106 | TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi), | 133 | TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi), |
@@ -114,7 +141,6 @@ DECLARE_EVENT_CLASS(wbc_class, | |||
114 | __field(int, for_background) | 141 | __field(int, for_background) |
115 | __field(int, for_reclaim) | 142 | __field(int, for_reclaim) |
116 | __field(int, range_cyclic) | 143 | __field(int, range_cyclic) |
117 | __field(unsigned long, older_than_this) | ||
118 | __field(long, range_start) | 144 | __field(long, range_start) |
119 | __field(long, range_end) | 145 | __field(long, range_end) |
120 | ), | 146 | ), |
@@ -128,14 +154,12 @@ DECLARE_EVENT_CLASS(wbc_class, | |||
128 | __entry->for_background = wbc->for_background; | 154 | __entry->for_background = wbc->for_background; |
129 | __entry->for_reclaim = wbc->for_reclaim; | 155 | __entry->for_reclaim = wbc->for_reclaim; |
130 | __entry->range_cyclic = wbc->range_cyclic; | 156 | __entry->range_cyclic = wbc->range_cyclic; |
131 | __entry->older_than_this = wbc->older_than_this ? | ||
132 | *wbc->older_than_this : 0; | ||
133 | __entry->range_start = (long)wbc->range_start; | 157 | __entry->range_start = (long)wbc->range_start; |
134 | __entry->range_end = (long)wbc->range_end; | 158 | __entry->range_end = (long)wbc->range_end; |
135 | ), | 159 | ), |
136 | 160 | ||
137 | TP_printk("bdi %s: towrt=%ld skip=%ld mode=%d kupd=%d " | 161 | TP_printk("bdi %s: towrt=%ld skip=%ld mode=%d kupd=%d " |
138 | "bgrd=%d reclm=%d cyclic=%d older=0x%lx " | 162 | "bgrd=%d reclm=%d cyclic=%d " |
139 | "start=0x%lx end=0x%lx", | 163 | "start=0x%lx end=0x%lx", |
140 | __entry->name, | 164 | __entry->name, |
141 | __entry->nr_to_write, | 165 | __entry->nr_to_write, |
@@ -145,7 +169,6 @@ DECLARE_EVENT_CLASS(wbc_class, | |||
145 | __entry->for_background, | 169 | __entry->for_background, |
146 | __entry->for_reclaim, | 170 | __entry->for_reclaim, |
147 | __entry->range_cyclic, | 171 | __entry->range_cyclic, |
148 | __entry->older_than_this, | ||
149 | __entry->range_start, | 172 | __entry->range_start, |
150 | __entry->range_end) | 173 | __entry->range_end) |
151 | ) | 174 | ) |
@@ -154,12 +177,6 @@ DECLARE_EVENT_CLASS(wbc_class, | |||
154 | DEFINE_EVENT(wbc_class, name, \ | 177 | DEFINE_EVENT(wbc_class, name, \ |
155 | TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi), \ | 178 | TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi), \ |
156 | TP_ARGS(wbc, bdi)) | 179 | TP_ARGS(wbc, bdi)) |
157 | DEFINE_WBC_EVENT(wbc_writeback_start); | ||
158 | DEFINE_WBC_EVENT(wbc_writeback_written); | ||
159 | DEFINE_WBC_EVENT(wbc_writeback_wait); | ||
160 | DEFINE_WBC_EVENT(wbc_balance_dirty_start); | ||
161 | DEFINE_WBC_EVENT(wbc_balance_dirty_written); | ||
162 | DEFINE_WBC_EVENT(wbc_balance_dirty_wait); | ||
163 | DEFINE_WBC_EVENT(wbc_writepage); | 180 | DEFINE_WBC_EVENT(wbc_writepage); |
164 | 181 | ||
165 | TRACE_EVENT(writeback_queue_io, | 182 | TRACE_EVENT(writeback_queue_io, |