writeback: Add tracepoint to track pending inode switches
Add trace_inode_switch_wbs_queue tracepoint to allow insight into how many inodes are queued to switch their bdi_writeback structure. Acked-by: Tejun Heo <tj@kernel.org> Signed-off-by: Jan Kara <jack@suse.cz> Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
@@ -667,6 +667,7 @@ static void inode_switch_wbs(struct inode *inode, int new_wb_id)
|
||||
|
||||
isw->inodes[0] = inode;
|
||||
|
||||
trace_inode_switch_wbs_queue(inode->i_wb, new_wb, 1);
|
||||
wb_queue_isw(new_wb, isw);
|
||||
return;
|
||||
|
||||
@@ -752,6 +753,7 @@ bool cleanup_offline_cgwb(struct bdi_writeback *wb)
|
||||
return restart;
|
||||
}
|
||||
|
||||
trace_inode_switch_wbs_queue(wb, new_wb, nr);
|
||||
wb_queue_isw(new_wb, isw);
|
||||
|
||||
return restart;
|
||||
|
||||
@@ -213,6 +213,35 @@ TRACE_EVENT(inode_foreign_history,
|
||||
)
|
||||
);
|
||||
|
||||
TRACE_EVENT(inode_switch_wbs_queue,
|
||||
|
||||
TP_PROTO(struct bdi_writeback *old_wb, struct bdi_writeback *new_wb,
|
||||
unsigned int count),
|
||||
|
||||
TP_ARGS(old_wb, new_wb, count),
|
||||
|
||||
TP_STRUCT__entry(
|
||||
__array(char, name, 32)
|
||||
__field(ino_t, old_cgroup_ino)
|
||||
__field(ino_t, new_cgroup_ino)
|
||||
__field(unsigned int, count)
|
||||
),
|
||||
|
||||
TP_fast_assign(
|
||||
strscpy_pad(__entry->name, bdi_dev_name(old_wb->bdi), 32);
|
||||
__entry->old_cgroup_ino = __trace_wb_assign_cgroup(old_wb);
|
||||
__entry->new_cgroup_ino = __trace_wb_assign_cgroup(new_wb);
|
||||
__entry->count = count;
|
||||
),
|
||||
|
||||
TP_printk("bdi %s: old_cgroup_ino=%lu new_cgroup_ino=%lu count=%u",
|
||||
__entry->name,
|
||||
(unsigned long)__entry->old_cgroup_ino,
|
||||
(unsigned long)__entry->new_cgroup_ino,
|
||||
__entry->count
|
||||
)
|
||||
);
|
||||
|
||||
TRACE_EVENT(inode_switch_wbs,
|
||||
|
||||
TP_PROTO(struct inode *inode, struct bdi_writeback *old_wb,
|
||||
|
||||
Reference in New Issue
Block a user