for-linus-20180922
-----BEGIN PGP SIGNATURE----- iQJEBAABCAAuFiEEwPw5LcreJtl1+l5K99NY+ylx4KYFAlumsbMQHGF4Ym9lQGtl cm5lbC5kawAKCRD301j7KXHgpvepEACYfXXSUuDrZ/hlTOnkCEuOIMhvwDlCSq+z QjLPUQCmnIeWthSbTAZ8skUEgqUtlkMkJcTUB+JIDlub3hZVMvNDvVi7JH5kkDVo GuVXA+Ip4O9AOuwMObgGXD8uWpCJ1muF2oUrFnZsUYwQLyZ/vnQFXPxdyVtagZtL Udwr9U2jfOzLa4fhhn+lDmLXLQSS4F1s4BxSn0HGlq7MIU3+/miZeMOwo+xtw+cn a06pdd+sdIHWbOiLP0ycVbtwasaNhdVG5vj0ViMnZw/N1MidBirzqbsdZ3dGdnoE V1Ba1axoMdm/mpGt7Xb0J2oze7rAcGNAGHJ0dEU51oj8X32kIwlXuLTJWv3Z0joF KEvJBVGK+2/K3jbmibrHFXE7pe+9cKGgV+s3C973XpoYtdIMxi4D7iADwXvSf+vw 8bWUp5RTf0aMNTdkqn7Mj+w0NzNgd4pSLgNgUZdrWpggTl021xOkyS2T/cNDY9pj J4eJu+gSNN8dAu3NZmZb+7mdGaXwXoaKMWnYFr3ADf9bpkSosQOfSFClRXFqR1ng 54b3nVL9UdqQNltuppu/LCQWAbU464jAS3uoR3h4e4WGFVL4oMpA6OMc0XzODkEO X+7LHq5tQcPu9eTFmGjchS1tK6AhyQVkHeOkQaLdJLWvlQoMOQgmeAhh4HaF7XqM dBeuwZqBqQ== =7uhx -----END PGP SIGNATURE----- Merge tag 'for-linus-20180922' of git://git.kernel.dk/linux-block Jens writes: "Just a single fix in this pull request, fixing a regression in /proc/diskstats caused by the unification of timestamps." * tag 'for-linus-20180922' of git://git.kernel.dk/linux-block: block: use nanosecond resolution for iostat
This commit is contained in:
commit
a83f87c1d2
@ -1684,7 +1684,7 @@ void generic_end_io_acct(struct request_queue *q, int req_op,
|
|||||||
const int sgrp = op_stat_group(req_op);
|
const int sgrp = op_stat_group(req_op);
|
||||||
int cpu = part_stat_lock();
|
int cpu = part_stat_lock();
|
||||||
|
|
||||||
part_stat_add(cpu, part, ticks[sgrp], duration);
|
part_stat_add(cpu, part, nsecs[sgrp], jiffies_to_nsecs(duration));
|
||||||
part_round_stats(q, cpu, part);
|
part_round_stats(q, cpu, part);
|
||||||
part_dec_in_flight(q, part, op_is_write(req_op));
|
part_dec_in_flight(q, part, op_is_write(req_op));
|
||||||
|
|
||||||
|
@ -2733,17 +2733,15 @@ void blk_account_io_done(struct request *req, u64 now)
|
|||||||
* containing request is enough.
|
* containing request is enough.
|
||||||
*/
|
*/
|
||||||
if (blk_do_io_stat(req) && !(req->rq_flags & RQF_FLUSH_SEQ)) {
|
if (blk_do_io_stat(req) && !(req->rq_flags & RQF_FLUSH_SEQ)) {
|
||||||
unsigned long duration;
|
|
||||||
const int sgrp = op_stat_group(req_op(req));
|
const int sgrp = op_stat_group(req_op(req));
|
||||||
struct hd_struct *part;
|
struct hd_struct *part;
|
||||||
int cpu;
|
int cpu;
|
||||||
|
|
||||||
duration = nsecs_to_jiffies(now - req->start_time_ns);
|
|
||||||
cpu = part_stat_lock();
|
cpu = part_stat_lock();
|
||||||
part = req->part;
|
part = req->part;
|
||||||
|
|
||||||
part_stat_inc(cpu, part, ios[sgrp]);
|
part_stat_inc(cpu, part, ios[sgrp]);
|
||||||
part_stat_add(cpu, part, ticks[sgrp], duration);
|
part_stat_add(cpu, part, nsecs[sgrp], now - req->start_time_ns);
|
||||||
part_round_stats(req->q, cpu, part);
|
part_round_stats(req->q, cpu, part);
|
||||||
part_dec_in_flight(req->q, part, rq_data_dir(req));
|
part_dec_in_flight(req->q, part, rq_data_dir(req));
|
||||||
|
|
||||||
|
@ -1343,18 +1343,18 @@ static int diskstats_show(struct seq_file *seqf, void *v)
|
|||||||
part_stat_read(hd, ios[STAT_READ]),
|
part_stat_read(hd, ios[STAT_READ]),
|
||||||
part_stat_read(hd, merges[STAT_READ]),
|
part_stat_read(hd, merges[STAT_READ]),
|
||||||
part_stat_read(hd, sectors[STAT_READ]),
|
part_stat_read(hd, sectors[STAT_READ]),
|
||||||
jiffies_to_msecs(part_stat_read(hd, ticks[STAT_READ])),
|
(unsigned int)part_stat_read_msecs(hd, STAT_READ),
|
||||||
part_stat_read(hd, ios[STAT_WRITE]),
|
part_stat_read(hd, ios[STAT_WRITE]),
|
||||||
part_stat_read(hd, merges[STAT_WRITE]),
|
part_stat_read(hd, merges[STAT_WRITE]),
|
||||||
part_stat_read(hd, sectors[STAT_WRITE]),
|
part_stat_read(hd, sectors[STAT_WRITE]),
|
||||||
jiffies_to_msecs(part_stat_read(hd, ticks[STAT_WRITE])),
|
(unsigned int)part_stat_read_msecs(hd, STAT_WRITE),
|
||||||
inflight[0],
|
inflight[0],
|
||||||
jiffies_to_msecs(part_stat_read(hd, io_ticks)),
|
jiffies_to_msecs(part_stat_read(hd, io_ticks)),
|
||||||
jiffies_to_msecs(part_stat_read(hd, time_in_queue)),
|
jiffies_to_msecs(part_stat_read(hd, time_in_queue)),
|
||||||
part_stat_read(hd, ios[STAT_DISCARD]),
|
part_stat_read(hd, ios[STAT_DISCARD]),
|
||||||
part_stat_read(hd, merges[STAT_DISCARD]),
|
part_stat_read(hd, merges[STAT_DISCARD]),
|
||||||
part_stat_read(hd, sectors[STAT_DISCARD]),
|
part_stat_read(hd, sectors[STAT_DISCARD]),
|
||||||
jiffies_to_msecs(part_stat_read(hd, ticks[STAT_DISCARD]))
|
(unsigned int)part_stat_read_msecs(hd, STAT_DISCARD)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
disk_part_iter_exit(&piter);
|
disk_part_iter_exit(&piter);
|
||||||
|
@ -136,18 +136,18 @@ ssize_t part_stat_show(struct device *dev,
|
|||||||
part_stat_read(p, ios[STAT_READ]),
|
part_stat_read(p, ios[STAT_READ]),
|
||||||
part_stat_read(p, merges[STAT_READ]),
|
part_stat_read(p, merges[STAT_READ]),
|
||||||
(unsigned long long)part_stat_read(p, sectors[STAT_READ]),
|
(unsigned long long)part_stat_read(p, sectors[STAT_READ]),
|
||||||
jiffies_to_msecs(part_stat_read(p, ticks[STAT_READ])),
|
(unsigned int)part_stat_read_msecs(p, STAT_READ),
|
||||||
part_stat_read(p, ios[STAT_WRITE]),
|
part_stat_read(p, ios[STAT_WRITE]),
|
||||||
part_stat_read(p, merges[STAT_WRITE]),
|
part_stat_read(p, merges[STAT_WRITE]),
|
||||||
(unsigned long long)part_stat_read(p, sectors[STAT_WRITE]),
|
(unsigned long long)part_stat_read(p, sectors[STAT_WRITE]),
|
||||||
jiffies_to_msecs(part_stat_read(p, ticks[STAT_WRITE])),
|
(unsigned int)part_stat_read_msecs(p, STAT_WRITE),
|
||||||
inflight[0],
|
inflight[0],
|
||||||
jiffies_to_msecs(part_stat_read(p, io_ticks)),
|
jiffies_to_msecs(part_stat_read(p, io_ticks)),
|
||||||
jiffies_to_msecs(part_stat_read(p, time_in_queue)),
|
jiffies_to_msecs(part_stat_read(p, time_in_queue)),
|
||||||
part_stat_read(p, ios[STAT_DISCARD]),
|
part_stat_read(p, ios[STAT_DISCARD]),
|
||||||
part_stat_read(p, merges[STAT_DISCARD]),
|
part_stat_read(p, merges[STAT_DISCARD]),
|
||||||
(unsigned long long)part_stat_read(p, sectors[STAT_DISCARD]),
|
(unsigned long long)part_stat_read(p, sectors[STAT_DISCARD]),
|
||||||
jiffies_to_msecs(part_stat_read(p, ticks[STAT_DISCARD])));
|
(unsigned int)part_stat_read_msecs(p, STAT_DISCARD));
|
||||||
}
|
}
|
||||||
|
|
||||||
ssize_t part_inflight_show(struct device *dev, struct device_attribute *attr,
|
ssize_t part_inflight_show(struct device *dev, struct device_attribute *attr,
|
||||||
|
@ -83,10 +83,10 @@ struct partition {
|
|||||||
} __attribute__((packed));
|
} __attribute__((packed));
|
||||||
|
|
||||||
struct disk_stats {
|
struct disk_stats {
|
||||||
|
u64 nsecs[NR_STAT_GROUPS];
|
||||||
unsigned long sectors[NR_STAT_GROUPS];
|
unsigned long sectors[NR_STAT_GROUPS];
|
||||||
unsigned long ios[NR_STAT_GROUPS];
|
unsigned long ios[NR_STAT_GROUPS];
|
||||||
unsigned long merges[NR_STAT_GROUPS];
|
unsigned long merges[NR_STAT_GROUPS];
|
||||||
unsigned long ticks[NR_STAT_GROUPS];
|
|
||||||
unsigned long io_ticks;
|
unsigned long io_ticks;
|
||||||
unsigned long time_in_queue;
|
unsigned long time_in_queue;
|
||||||
};
|
};
|
||||||
@ -354,6 +354,9 @@ static inline void free_part_stats(struct hd_struct *part)
|
|||||||
|
|
||||||
#endif /* CONFIG_SMP */
|
#endif /* CONFIG_SMP */
|
||||||
|
|
||||||
|
#define part_stat_read_msecs(part, which) \
|
||||||
|
div_u64(part_stat_read(part, nsecs[which]), NSEC_PER_MSEC)
|
||||||
|
|
||||||
#define part_stat_read_accum(part, field) \
|
#define part_stat_read_accum(part, field) \
|
||||||
(part_stat_read(part, field[STAT_READ]) + \
|
(part_stat_read(part, field[STAT_READ]) + \
|
||||||
part_stat_read(part, field[STAT_WRITE]) + \
|
part_stat_read(part, field[STAT_WRITE]) + \
|
||||||
|
Loading…
Reference in New Issue
Block a user