diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-11-06 22:02:23 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-11-06 22:02:23 -0500 |
commit | 208bca0860406d16398145ddd950036a737c3c9d (patch) | |
tree | 7797a16c17d8bd155120126fa7976727fc6de013 /include/trace | |
parent | 6aad3738f6a79fd0ca480eaceefe064cc471f6eb (diff) | |
parent | 0e175a1835ffc979e55787774e58ec79e41957d7 (diff) |
Merge branch 'writeback-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/wfg/linux
* 'writeback-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/wfg/linux:
writeback: Add a 'reason' to wb_writeback_work
writeback: send work item to queue_io, move_expired_inodes
writeback: trace event balance_dirty_pages
writeback: trace event bdi_dirty_ratelimit
writeback: fix ppc compile warnings on do_div(long long, unsigned long)
writeback: per-bdi background threshold
writeback: dirty position control - bdi reserve area
writeback: control dirty pause time
writeback: limit max dirty pause time
writeback: IO-less balance_dirty_pages()
writeback: per task dirty rate limit
writeback: stabilize bdi->dirty_ratelimit
writeback: dirty rate control
writeback: add bg_threshold parameter to __bdi_update_bandwidth()
writeback: dirty position control
writeback: account per-bdi accumulated dirtied pages
Diffstat (limited to 'include/trace')
-rw-r--r-- | include/trace/events/writeback.h | 161 |
1 files changed, 131 insertions, 30 deletions
diff --git a/include/trace/events/writeback.h b/include/trace/events/writeback.h index 5f172703eb4f..b99caa8b780c 100644 --- a/include/trace/events/writeback.h +++ b/include/trace/events/writeback.h | |||
@@ -34,6 +34,7 @@ DECLARE_EVENT_CLASS(writeback_work_class, | |||
34 | __field(int, for_kupdate) | 34 | __field(int, for_kupdate) |
35 | __field(int, range_cyclic) | 35 | __field(int, range_cyclic) |
36 | __field(int, for_background) | 36 | __field(int, for_background) |
37 | __field(int, reason) | ||
37 | ), | 38 | ), |
38 | TP_fast_assign( | 39 | TP_fast_assign( |
39 | strncpy(__entry->name, dev_name(bdi->dev), 32); | 40 | strncpy(__entry->name, dev_name(bdi->dev), 32); |
@@ -43,16 +44,18 @@ DECLARE_EVENT_CLASS(writeback_work_class, | |||
43 | __entry->for_kupdate = work->for_kupdate; | 44 | __entry->for_kupdate = work->for_kupdate; |
44 | __entry->range_cyclic = work->range_cyclic; | 45 | __entry->range_cyclic = work->range_cyclic; |
45 | __entry->for_background = work->for_background; | 46 | __entry->for_background = work->for_background; |
47 | __entry->reason = work->reason; | ||
46 | ), | 48 | ), |
47 | TP_printk("bdi %s: sb_dev %d:%d nr_pages=%ld sync_mode=%d " | 49 | TP_printk("bdi %s: sb_dev %d:%d nr_pages=%ld sync_mode=%d " |
48 | "kupdate=%d range_cyclic=%d background=%d", | 50 | "kupdate=%d range_cyclic=%d background=%d reason=%s", |
49 | __entry->name, | 51 | __entry->name, |
50 | MAJOR(__entry->sb_dev), MINOR(__entry->sb_dev), | 52 | MAJOR(__entry->sb_dev), MINOR(__entry->sb_dev), |
51 | __entry->nr_pages, | 53 | __entry->nr_pages, |
52 | __entry->sync_mode, | 54 | __entry->sync_mode, |
53 | __entry->for_kupdate, | 55 | __entry->for_kupdate, |
54 | __entry->range_cyclic, | 56 | __entry->range_cyclic, |
55 | __entry->for_background | 57 | __entry->for_background, |
58 | wb_reason_name[__entry->reason] | ||
56 | ) | 59 | ) |
57 | ); | 60 | ); |
58 | #define DEFINE_WRITEBACK_WORK_EVENT(name) \ | 61 | #define DEFINE_WRITEBACK_WORK_EVENT(name) \ |
@@ -104,30 +107,6 @@ DEFINE_WRITEBACK_EVENT(writeback_bdi_register); | |||
104 | DEFINE_WRITEBACK_EVENT(writeback_bdi_unregister); | 107 | DEFINE_WRITEBACK_EVENT(writeback_bdi_unregister); |
105 | DEFINE_WRITEBACK_EVENT(writeback_thread_start); | 108 | DEFINE_WRITEBACK_EVENT(writeback_thread_start); |
106 | DEFINE_WRITEBACK_EVENT(writeback_thread_stop); | 109 | 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 | ); | ||
131 | 110 | ||
132 | DECLARE_EVENT_CLASS(wbc_class, | 111 | DECLARE_EVENT_CLASS(wbc_class, |
133 | TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi), | 112 | TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi), |
@@ -181,27 +160,31 @@ DEFINE_WBC_EVENT(wbc_writepage); | |||
181 | 160 | ||
182 | TRACE_EVENT(writeback_queue_io, | 161 | TRACE_EVENT(writeback_queue_io, |
183 | TP_PROTO(struct bdi_writeback *wb, | 162 | TP_PROTO(struct bdi_writeback *wb, |
184 | unsigned long *older_than_this, | 163 | struct wb_writeback_work *work, |
185 | int moved), | 164 | int moved), |
186 | TP_ARGS(wb, older_than_this, moved), | 165 | TP_ARGS(wb, work, moved), |
187 | TP_STRUCT__entry( | 166 | TP_STRUCT__entry( |
188 | __array(char, name, 32) | 167 | __array(char, name, 32) |
189 | __field(unsigned long, older) | 168 | __field(unsigned long, older) |
190 | __field(long, age) | 169 | __field(long, age) |
191 | __field(int, moved) | 170 | __field(int, moved) |
171 | __field(int, reason) | ||
192 | ), | 172 | ), |
193 | TP_fast_assign( | 173 | TP_fast_assign( |
174 | unsigned long *older_than_this = work->older_than_this; | ||
194 | strncpy(__entry->name, dev_name(wb->bdi->dev), 32); | 175 | strncpy(__entry->name, dev_name(wb->bdi->dev), 32); |
195 | __entry->older = older_than_this ? *older_than_this : 0; | 176 | __entry->older = older_than_this ? *older_than_this : 0; |
196 | __entry->age = older_than_this ? | 177 | __entry->age = older_than_this ? |
197 | (jiffies - *older_than_this) * 1000 / HZ : -1; | 178 | (jiffies - *older_than_this) * 1000 / HZ : -1; |
198 | __entry->moved = moved; | 179 | __entry->moved = moved; |
180 | __entry->reason = work->reason; | ||
199 | ), | 181 | ), |
200 | TP_printk("bdi %s: older=%lu age=%ld enqueue=%d", | 182 | TP_printk("bdi %s: older=%lu age=%ld enqueue=%d reason=%s", |
201 | __entry->name, | 183 | __entry->name, |
202 | __entry->older, /* older_than_this in jiffies */ | 184 | __entry->older, /* older_than_this in jiffies */ |
203 | __entry->age, /* older_than_this in relative milliseconds */ | 185 | __entry->age, /* older_than_this in relative milliseconds */ |
204 | __entry->moved) | 186 | __entry->moved, |
187 | wb_reason_name[__entry->reason]) | ||
205 | ); | 188 | ); |
206 | 189 | ||
207 | TRACE_EVENT(global_dirty_state, | 190 | TRACE_EVENT(global_dirty_state, |
@@ -250,6 +233,124 @@ TRACE_EVENT(global_dirty_state, | |||
250 | ) | 233 | ) |
251 | ); | 234 | ); |
252 | 235 | ||
236 | #define KBps(x) ((x) << (PAGE_SHIFT - 10)) | ||
237 | |||
238 | TRACE_EVENT(bdi_dirty_ratelimit, | ||
239 | |||
240 | TP_PROTO(struct backing_dev_info *bdi, | ||
241 | unsigned long dirty_rate, | ||
242 | unsigned long task_ratelimit), | ||
243 | |||
244 | TP_ARGS(bdi, dirty_rate, task_ratelimit), | ||
245 | |||
246 | TP_STRUCT__entry( | ||
247 | __array(char, bdi, 32) | ||
248 | __field(unsigned long, write_bw) | ||
249 | __field(unsigned long, avg_write_bw) | ||
250 | __field(unsigned long, dirty_rate) | ||
251 | __field(unsigned long, dirty_ratelimit) | ||
252 | __field(unsigned long, task_ratelimit) | ||
253 | __field(unsigned long, balanced_dirty_ratelimit) | ||
254 | ), | ||
255 | |||
256 | TP_fast_assign( | ||
257 | strlcpy(__entry->bdi, dev_name(bdi->dev), 32); | ||
258 | __entry->write_bw = KBps(bdi->write_bandwidth); | ||
259 | __entry->avg_write_bw = KBps(bdi->avg_write_bandwidth); | ||
260 | __entry->dirty_rate = KBps(dirty_rate); | ||
261 | __entry->dirty_ratelimit = KBps(bdi->dirty_ratelimit); | ||
262 | __entry->task_ratelimit = KBps(task_ratelimit); | ||
263 | __entry->balanced_dirty_ratelimit = | ||
264 | KBps(bdi->balanced_dirty_ratelimit); | ||
265 | ), | ||
266 | |||
267 | TP_printk("bdi %s: " | ||
268 | "write_bw=%lu awrite_bw=%lu dirty_rate=%lu " | ||
269 | "dirty_ratelimit=%lu task_ratelimit=%lu " | ||
270 | "balanced_dirty_ratelimit=%lu", | ||
271 | __entry->bdi, | ||
272 | __entry->write_bw, /* write bandwidth */ | ||
273 | __entry->avg_write_bw, /* avg write bandwidth */ | ||
274 | __entry->dirty_rate, /* bdi dirty rate */ | ||
275 | __entry->dirty_ratelimit, /* base ratelimit */ | ||
276 | __entry->task_ratelimit, /* ratelimit with position control */ | ||
277 | __entry->balanced_dirty_ratelimit /* the balanced ratelimit */ | ||
278 | ) | ||
279 | ); | ||
280 | |||
281 | TRACE_EVENT(balance_dirty_pages, | ||
282 | |||
283 | TP_PROTO(struct backing_dev_info *bdi, | ||
284 | unsigned long thresh, | ||
285 | unsigned long bg_thresh, | ||
286 | unsigned long dirty, | ||
287 | unsigned long bdi_thresh, | ||
288 | unsigned long bdi_dirty, | ||
289 | unsigned long dirty_ratelimit, | ||
290 | unsigned long task_ratelimit, | ||
291 | unsigned long dirtied, | ||
292 | long pause, | ||
293 | unsigned long start_time), | ||
294 | |||
295 | TP_ARGS(bdi, thresh, bg_thresh, dirty, bdi_thresh, bdi_dirty, | ||
296 | dirty_ratelimit, task_ratelimit, | ||
297 | dirtied, pause, start_time), | ||
298 | |||
299 | TP_STRUCT__entry( | ||
300 | __array( char, bdi, 32) | ||
301 | __field(unsigned long, limit) | ||
302 | __field(unsigned long, setpoint) | ||
303 | __field(unsigned long, dirty) | ||
304 | __field(unsigned long, bdi_setpoint) | ||
305 | __field(unsigned long, bdi_dirty) | ||
306 | __field(unsigned long, dirty_ratelimit) | ||
307 | __field(unsigned long, task_ratelimit) | ||
308 | __field(unsigned int, dirtied) | ||
309 | __field(unsigned int, dirtied_pause) | ||
310 | __field(unsigned long, paused) | ||
311 | __field( long, pause) | ||
312 | ), | ||
313 | |||
314 | TP_fast_assign( | ||
315 | unsigned long freerun = (thresh + bg_thresh) / 2; | ||
316 | strlcpy(__entry->bdi, dev_name(bdi->dev), 32); | ||
317 | |||
318 | __entry->limit = global_dirty_limit; | ||
319 | __entry->setpoint = (global_dirty_limit + freerun) / 2; | ||
320 | __entry->dirty = dirty; | ||
321 | __entry->bdi_setpoint = __entry->setpoint * | ||
322 | bdi_thresh / (thresh + 1); | ||
323 | __entry->bdi_dirty = bdi_dirty; | ||
324 | __entry->dirty_ratelimit = KBps(dirty_ratelimit); | ||
325 | __entry->task_ratelimit = KBps(task_ratelimit); | ||
326 | __entry->dirtied = dirtied; | ||
327 | __entry->dirtied_pause = current->nr_dirtied_pause; | ||
328 | __entry->pause = pause * 1000 / HZ; | ||
329 | __entry->paused = (jiffies - start_time) * 1000 / HZ; | ||
330 | ), | ||
331 | |||
332 | |||
333 | TP_printk("bdi %s: " | ||
334 | "limit=%lu setpoint=%lu dirty=%lu " | ||
335 | "bdi_setpoint=%lu bdi_dirty=%lu " | ||
336 | "dirty_ratelimit=%lu task_ratelimit=%lu " | ||
337 | "dirtied=%u dirtied_pause=%u " | ||
338 | "paused=%lu pause=%ld", | ||
339 | __entry->bdi, | ||
340 | __entry->limit, | ||
341 | __entry->setpoint, | ||
342 | __entry->dirty, | ||
343 | __entry->bdi_setpoint, | ||
344 | __entry->bdi_dirty, | ||
345 | __entry->dirty_ratelimit, | ||
346 | __entry->task_ratelimit, | ||
347 | __entry->dirtied, | ||
348 | __entry->dirtied_pause, | ||
349 | __entry->paused, /* ms */ | ||
350 | __entry->pause /* ms */ | ||
351 | ) | ||
352 | ); | ||
353 | |||
253 | DECLARE_EVENT_CLASS(writeback_congest_waited_template, | 354 | DECLARE_EVENT_CLASS(writeback_congest_waited_template, |
254 | 355 | ||
255 | TP_PROTO(unsigned int usec_timeout, unsigned int usec_delayed), | 356 | TP_PROTO(unsigned int usec_timeout, unsigned int usec_delayed), |