aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorDave Chinner <david@fromorbit.com>2010-07-06 23:24:06 -0400
committerJens Axboe <jaxboe@fusionio.com>2010-08-07 12:24:23 -0400
commit455b2864686d3591b3b2f39eb46290c95f76471f (patch)
treeb88059e3691fc5ad4491518e9eb1f1f2ba21711a /mm
parenta89f5c899db3c6be4bb426e4efb72ecee29a93b5 (diff)
writeback: Initial tracing support
Trace queue/sched/exec parts of the writeback loop. This provides insight into when and why flusher threads are scheduled to run. e.g a sync invocation leaves traces like: sync-[...]: writeback_queue: bdi 8:0: sb_dev 8:1 nr_pages=7712 sync_mode=0 kupdate=0 range_cyclic=0 background=0 flush-8:0-[...]: writeback_exec: bdi 8:0: sb_dev 8:1 nr_pages=7712 sync_mode=0 kupdate=0 range_cyclic=0 background=0 This also lays the foundation for adding more writeback tracing to provide deeper insight into the whole writeback path. The original tracing code is from Jens Axboe, though this version is a rewrite as a result of the code being traced changing significantly. Signed-off-by: Dave Chinner <dchinner@redhat.com> Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
Diffstat (limited to 'mm')
-rw-r--r--mm/backing-dev.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/mm/backing-dev.c b/mm/backing-dev.c
index bceac647e4d1..ac78a3336181 100644
--- a/mm/backing-dev.c
+++ b/mm/backing-dev.c
@@ -10,6 +10,7 @@
10#include <linux/module.h> 10#include <linux/module.h>
11#include <linux/writeback.h> 11#include <linux/writeback.h>
12#include <linux/device.h> 12#include <linux/device.h>
13#include <trace/events/writeback.h>
13 14
14static atomic_long_t bdi_seq = ATOMIC_LONG_INIT(0); 15static atomic_long_t bdi_seq = ATOMIC_LONG_INIT(0);
15 16
@@ -518,6 +519,7 @@ int bdi_register(struct backing_dev_info *bdi, struct device *parent,
518 519
519 bdi_debug_register(bdi, dev_name(dev)); 520 bdi_debug_register(bdi, dev_name(dev));
520 set_bit(BDI_registered, &bdi->state); 521 set_bit(BDI_registered, &bdi->state);
522 trace_writeback_bdi_register(bdi);
521exit: 523exit:
522 return ret; 524 return ret;
523} 525}
@@ -578,6 +580,7 @@ static void bdi_prune_sb(struct backing_dev_info *bdi)
578void bdi_unregister(struct backing_dev_info *bdi) 580void bdi_unregister(struct backing_dev_info *bdi)
579{ 581{
580 if (bdi->dev) { 582 if (bdi->dev) {
583 trace_writeback_bdi_unregister(bdi);
581 bdi_prune_sb(bdi); 584 bdi_prune_sb(bdi);
582 585
583 if (!bdi_cap_flush_forker(bdi)) 586 if (!bdi_cap_flush_forker(bdi))