aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/trace/events/writeback.h45
-rw-r--r--mm/page-writeback.c2
2 files changed, 47 insertions, 0 deletions
diff --git a/include/trace/events/writeback.h b/include/trace/events/writeback.h
index 178c23508d3d..ffb5deb77ca9 100644
--- a/include/trace/events/writeback.h
+++ b/include/trace/events/writeback.h
@@ -226,6 +226,51 @@ TRACE_EVENT(global_dirty_state,
226 ) 226 )
227); 227);
228 228
229#define KBps(x) ((x) << (PAGE_SHIFT - 10))
230
231TRACE_EVENT(bdi_dirty_ratelimit,
232
233 TP_PROTO(struct backing_dev_info *bdi,
234 unsigned long dirty_rate,
235 unsigned long task_ratelimit),
236
237 TP_ARGS(bdi, dirty_rate, task_ratelimit),
238
239 TP_STRUCT__entry(
240 __array(char, bdi, 32)
241 __field(unsigned long, write_bw)
242 __field(unsigned long, avg_write_bw)
243 __field(unsigned long, dirty_rate)
244 __field(unsigned long, dirty_ratelimit)
245 __field(unsigned long, task_ratelimit)
246 __field(unsigned long, balanced_dirty_ratelimit)
247 ),
248
249 TP_fast_assign(
250 strlcpy(__entry->bdi, dev_name(bdi->dev), 32);
251 __entry->write_bw = KBps(bdi->write_bandwidth);
252 __entry->avg_write_bw = KBps(bdi->avg_write_bandwidth);
253 __entry->dirty_rate = KBps(dirty_rate);
254 __entry->dirty_ratelimit = KBps(bdi->dirty_ratelimit);
255 __entry->task_ratelimit = KBps(task_ratelimit);
256 __entry->balanced_dirty_ratelimit =
257 KBps(bdi->balanced_dirty_ratelimit);
258 ),
259
260 TP_printk("bdi %s: "
261 "write_bw=%lu awrite_bw=%lu dirty_rate=%lu "
262 "dirty_ratelimit=%lu task_ratelimit=%lu "
263 "balanced_dirty_ratelimit=%lu",
264 __entry->bdi,
265 __entry->write_bw, /* write bandwidth */
266 __entry->avg_write_bw, /* avg write bandwidth */
267 __entry->dirty_rate, /* bdi dirty rate */
268 __entry->dirty_ratelimit, /* base ratelimit */
269 __entry->task_ratelimit, /* ratelimit with position control */
270 __entry->balanced_dirty_ratelimit /* the balanced ratelimit */
271 )
272);
273
229DECLARE_EVENT_CLASS(writeback_congest_waited_template, 274DECLARE_EVENT_CLASS(writeback_congest_waited_template,
230 275
231 TP_PROTO(unsigned int usec_timeout, unsigned int usec_delayed), 276 TP_PROTO(unsigned int usec_timeout, unsigned int usec_delayed),
diff --git a/mm/page-writeback.c b/mm/page-writeback.c
index 0802d5177997..e3c2d8bf87bb 100644
--- a/mm/page-writeback.c
+++ b/mm/page-writeback.c
@@ -875,6 +875,8 @@ static void bdi_update_dirty_ratelimit(struct backing_dev_info *bdi,
875 875
876 bdi->dirty_ratelimit = max(dirty_ratelimit, 1UL); 876 bdi->dirty_ratelimit = max(dirty_ratelimit, 1UL);
877 bdi->balanced_dirty_ratelimit = balanced_dirty_ratelimit; 877 bdi->balanced_dirty_ratelimit = balanced_dirty_ratelimit;
878
879 trace_bdi_dirty_ratelimit(bdi, dirty_rate, task_ratelimit);
878} 880}
879 881
880void __bdi_update_bandwidth(struct backing_dev_info *bdi, 882void __bdi_update_bandwidth(struct backing_dev_info *bdi,