5 * Disk utils as read in /sys/block/<dev>/stat
7 struct disk_util_stat {
10 unsigned long long sectors[2];
13 unsigned time_in_queue;
17 * Per-device disk util management
20 struct flist_head list;
21 /* If this disk is a slave, hook it into the master's
22 * list using this head.
24 struct flist_head slavelist;
31 struct disk_util_stat dus;
32 struct disk_util_stat last_dus;
34 /* For software raids, this entry maintains pointers to the
35 * entries for the slave devices. The disk_util entries for
36 * the slaves devices should primarily be maintained through
37 * the disk_list list, i.e. for memory allocation and
38 * de-allocation, etc. Whereas this list should be used only
39 * for aggregating a software RAID's disk util figures.
41 struct flist_head slaves;
46 struct fio_mutex *lock;
50 static inline void disk_util_mod(struct disk_util *du, int val)
55 fio_mutex_down(du->lock);
58 flist_for_each(n, &du->slavelist) {
59 struct disk_util *slave;
61 slave = flist_entry(n, struct disk_util, slavelist);
64 fio_mutex_up(du->lock);
67 static inline void disk_util_inc(struct disk_util *du)
72 static inline void disk_util_dec(struct disk_util *du)
74 disk_util_mod(du, -1);
77 #define DISK_UTIL_MSEC (250)
82 #ifdef FIO_HAVE_DISK_UTIL
83 extern void show_disk_util(void);
84 extern void init_disk_util(struct thread_data *);
85 extern void update_io_ticks(void);
87 #define show_disk_util()
88 #define init_disk_util(td)
89 #define update_io_ticks()