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

Changed files
+12 -11
block
include
linux
+1 -1
block/bio.c
··· 1684 1684 const int sgrp = op_stat_group(req_op); 1685 1685 int cpu = part_stat_lock(); 1686 1686 1687 - part_stat_add(cpu, part, ticks[sgrp], duration); 1687 + part_stat_add(cpu, part, nsecs[sgrp], jiffies_to_nsecs(duration)); 1688 1688 part_round_stats(q, cpu, part); 1689 1689 part_dec_in_flight(q, part, op_is_write(req_op)); 1690 1690
+1 -3
block/blk-core.c
··· 2733 2733 * containing request is enough. 2734 2734 */ 2735 2735 if (blk_do_io_stat(req) && !(req->rq_flags & RQF_FLUSH_SEQ)) { 2736 - unsigned long duration; 2737 2736 const int sgrp = op_stat_group(req_op(req)); 2738 2737 struct hd_struct *part; 2739 2738 int cpu; 2740 2739 2741 - duration = nsecs_to_jiffies(now - req->start_time_ns); 2742 2740 cpu = part_stat_lock(); 2743 2741 part = req->part; 2744 2742 2745 2743 part_stat_inc(cpu, part, ios[sgrp]); 2746 - part_stat_add(cpu, part, ticks[sgrp], duration); 2744 + part_stat_add(cpu, part, nsecs[sgrp], now - req->start_time_ns); 2747 2745 part_round_stats(req->q, cpu, part); 2748 2746 part_dec_in_flight(req->q, part, rq_data_dir(req)); 2749 2747
+3 -3
block/genhd.c
··· 1343 1343 part_stat_read(hd, ios[STAT_READ]), 1344 1344 part_stat_read(hd, merges[STAT_READ]), 1345 1345 part_stat_read(hd, sectors[STAT_READ]), 1346 - jiffies_to_msecs(part_stat_read(hd, ticks[STAT_READ])), 1346 + (unsigned int)part_stat_read_msecs(hd, STAT_READ), 1347 1347 part_stat_read(hd, ios[STAT_WRITE]), 1348 1348 part_stat_read(hd, merges[STAT_WRITE]), 1349 1349 part_stat_read(hd, sectors[STAT_WRITE]), 1350 - jiffies_to_msecs(part_stat_read(hd, ticks[STAT_WRITE])), 1350 + (unsigned int)part_stat_read_msecs(hd, STAT_WRITE), 1351 1351 inflight[0], 1352 1352 jiffies_to_msecs(part_stat_read(hd, io_ticks)), 1353 1353 jiffies_to_msecs(part_stat_read(hd, time_in_queue)), 1354 1354 part_stat_read(hd, ios[STAT_DISCARD]), 1355 1355 part_stat_read(hd, merges[STAT_DISCARD]), 1356 1356 part_stat_read(hd, sectors[STAT_DISCARD]), 1357 - jiffies_to_msecs(part_stat_read(hd, ticks[STAT_DISCARD])) 1357 + (unsigned int)part_stat_read_msecs(hd, STAT_DISCARD) 1358 1358 ); 1359 1359 } 1360 1360 disk_part_iter_exit(&piter);
+3 -3
block/partition-generic.c
··· 136 136 part_stat_read(p, ios[STAT_READ]), 137 137 part_stat_read(p, merges[STAT_READ]), 138 138 (unsigned long long)part_stat_read(p, sectors[STAT_READ]), 139 - jiffies_to_msecs(part_stat_read(p, ticks[STAT_READ])), 139 + (unsigned int)part_stat_read_msecs(p, STAT_READ), 140 140 part_stat_read(p, ios[STAT_WRITE]), 141 141 part_stat_read(p, merges[STAT_WRITE]), 142 142 (unsigned long long)part_stat_read(p, sectors[STAT_WRITE]), 143 - jiffies_to_msecs(part_stat_read(p, ticks[STAT_WRITE])), 143 + (unsigned int)part_stat_read_msecs(p, STAT_WRITE), 144 144 inflight[0], 145 145 jiffies_to_msecs(part_stat_read(p, io_ticks)), 146 146 jiffies_to_msecs(part_stat_read(p, time_in_queue)), 147 147 part_stat_read(p, ios[STAT_DISCARD]), 148 148 part_stat_read(p, merges[STAT_DISCARD]), 149 149 (unsigned long long)part_stat_read(p, sectors[STAT_DISCARD]), 150 - jiffies_to_msecs(part_stat_read(p, ticks[STAT_DISCARD]))); 150 + (unsigned int)part_stat_read_msecs(p, STAT_DISCARD)); 151 151 } 152 152 153 153 ssize_t part_inflight_show(struct device *dev, struct device_attribute *attr,
+4 -1
include/linux/genhd.h
··· 83 83 } __attribute__((packed)); 84 84 85 85 struct disk_stats { 86 + u64 nsecs[NR_STAT_GROUPS]; 86 87 unsigned long sectors[NR_STAT_GROUPS]; 87 88 unsigned long ios[NR_STAT_GROUPS]; 88 89 unsigned long merges[NR_STAT_GROUPS]; 89 - unsigned long ticks[NR_STAT_GROUPS]; 90 90 unsigned long io_ticks; 91 91 unsigned long time_in_queue; 92 92 }; ··· 353 353 } 354 354 355 355 #endif /* CONFIG_SMP */ 356 + 357 + #define part_stat_read_msecs(part, which) \ 358 + div_u64(part_stat_read(part, nsecs[which]), NSEC_PER_MSEC) 356 359 357 360 #define part_stat_read_accum(part, field) \ 358 361 (part_stat_read(part, field[STAT_READ]) + \