f2fs: add to account direct IO
This patch adds f2fs_dio_submit_bio() to hook submit_io/end_io functions in direct IO path, in order to account DIO. Later, we will add this count into is_idle() to let background GC/Discard thread be aware of DIO. Signed-off-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
@@ -957,6 +957,8 @@ enum count_type {
|
||||
F2FS_RD_DATA,
|
||||
F2FS_RD_NODE,
|
||||
F2FS_RD_META,
|
||||
F2FS_DIO_WRITE,
|
||||
F2FS_DIO_READ,
|
||||
NR_COUNT_TYPE,
|
||||
};
|
||||
|
||||
@@ -1333,6 +1335,13 @@ struct f2fs_sb_info {
|
||||
__u32 s_chksum_seed;
|
||||
};
|
||||
|
||||
struct f2fs_private_dio {
|
||||
struct inode *inode;
|
||||
void *orig_private;
|
||||
bio_end_io_t *orig_end_io;
|
||||
bool write;
|
||||
};
|
||||
|
||||
#ifdef CONFIG_F2FS_FAULT_INJECTION
|
||||
#define f2fs_show_injection_info(type) \
|
||||
printk_ratelimited("%sF2FS-fs : inject %s in %s of %pF\n", \
|
||||
@@ -3152,6 +3161,7 @@ struct f2fs_stat_info {
|
||||
int total_count, utilization;
|
||||
int bg_gc, nr_wb_cp_data, nr_wb_data;
|
||||
int nr_rd_data, nr_rd_node, nr_rd_meta;
|
||||
int nr_dio_read, nr_dio_write;
|
||||
unsigned int io_skip_bggc, other_skip_bggc;
|
||||
int nr_flushing, nr_flushed, flush_list_empty;
|
||||
int nr_discarding, nr_discarded;
|
||||
|
Reference in New Issue
Block a user