Skip to content

Commit

Permalink
writeback: update writeback tracepoints to report cgroup
Browse files Browse the repository at this point in the history
The following tracepoints are updated to report the cgroup used during
cgroup writeback.

* writeback_write_inode[_start]
* writeback_queue
* writeback_exec
* writeback_start
* writeback_written
* writeback_wait
* writeback_nowork
* writeback_wake_background
* wbc_writepage
* writeback_queue_io
* bdi_dirty_ratelimit
* balance_dirty_pages
* writeback_sb_inodes_requeue
* writeback_single_inode[_start]

Note that writeback_bdi_register is separated out from writeback_class
as reporting cgroup doesn't make sense to it.  Tracepoints which take
bdi are updated to take bdi_writeback instead.

Signed-off-by: Tejun Heo <tj@kernel.org>
Suggested-by: Jan Kara <jack@suse.cz>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Jens Axboe <axboe@fb.com>
  • Loading branch information
htejun authored and axboe committed Aug 18, 2015
1 parent 9acee9c commit 5634cc2
Show file tree
Hide file tree
Showing 3 changed files with 151 additions and 49 deletions.
14 changes: 7 additions & 7 deletions fs/fs-writeback.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ static void wb_wakeup(struct bdi_writeback *wb)
static void wb_queue_work(struct bdi_writeback *wb,
struct wb_writeback_work *work)
{
trace_writeback_queue(wb->bdi, work);
trace_writeback_queue(wb, work);

spin_lock_bh(&wb->work_lock);
if (!test_bit(WB_registered, &wb->state))
Expand Down Expand Up @@ -883,7 +883,7 @@ void wb_start_writeback(struct bdi_writeback *wb, long nr_pages,
*/
work = kzalloc(sizeof(*work), GFP_ATOMIC);
if (!work) {
trace_writeback_nowork(wb->bdi);
trace_writeback_nowork(wb);
wb_wakeup(wb);
return;
}
Expand Down Expand Up @@ -913,7 +913,7 @@ void wb_start_background_writeback(struct bdi_writeback *wb)
* We just wake up the flusher thread. It will perform background
* writeback as soon as there is no other work to do.
*/
trace_writeback_wake_background(wb->bdi);
trace_writeback_wake_background(wb);
wb_wakeup(wb);
}

Expand Down Expand Up @@ -1616,14 +1616,14 @@ static long wb_writeback(struct bdi_writeback *wb,
} else if (work->for_background)
oldest_jif = jiffies;

trace_writeback_start(wb->bdi, work);
trace_writeback_start(wb, work);
if (list_empty(&wb->b_io))
queue_io(wb, work);
if (work->sb)
progress = writeback_sb_inodes(work->sb, wb, work);
else
progress = __writeback_inodes_wb(wb, work);
trace_writeback_written(wb->bdi, work);
trace_writeback_written(wb, work);

wb_update_bandwidth(wb, wb_start);

Expand All @@ -1648,7 +1648,7 @@ static long wb_writeback(struct bdi_writeback *wb,
* we'll just busyloop.
*/
if (!list_empty(&wb->b_more_io)) {
trace_writeback_wait(wb->bdi, work);
trace_writeback_wait(wb, work);
inode = wb_inode(wb->b_more_io.prev);
spin_lock(&inode->i_lock);
spin_unlock(&wb->list_lock);
Expand Down Expand Up @@ -1754,7 +1754,7 @@ static long wb_do_writeback(struct bdi_writeback *wb)
while ((work = get_next_work_item(wb)) != NULL) {
struct wb_completion *done = work->done;

trace_writeback_exec(wb->bdi, work);
trace_writeback_exec(wb, work);

wrote += wb_writeback(wb, work);

Expand Down
Loading

0 comments on commit 5634cc2

Please sign in to comment.