blktrace: fix accounting of partially completed requests
Roman Pen authored
commit af5040da

 upstream.

trace_block_rq_complete does not take into account that request can
be partially completed, so we can get the following incorrect output
of blkparser:

  C   R 232 + 240 [0]
  C   R 240 + 232 [0]
  C   R 248 + 224 [0]
  C   R 256 + 216 [0]

but should be:

  C   R 232 + 8 [0]
  C   R 240 + 8 [0]
  C   R 248 + 8 [0]
  C   R 256 + 8 [0]

Also, the whole output summary statistics of completed requests and
final throughput will be incorrect.

This patch takes into account real completion size of the request and
fixes wrong completion accounting.
Signed-off-by: default avatarRoman Pen <r.peniaev@gmail.com>
CC: Steven Rostedt <rostedt@goodmis.org>
CC: Frederic Weisbecker <fweisbec@gmail.com>
CC: Ingo Molnar <mingo@redhat.com>
CC: linux-kernel@vger.kernel.org
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
14eee5bd
Name Last commit Last update
..
partitions LDM: Fix reassembly of extended VBLKs.
Kconfig move fs/partitions to block/
Kconfig.iosched blk-cgroup: config options re-arrangement
Makefile separate partition format handling from generic code
blk-cgroup.c Merge branch 'for-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup
blk-cgroup.h block: fix a typo in the blk-cgroup.h file
blk-core.c blktrace: fix accounting of partially completed requests
blk-exec.c block: Don't access request after it might be freed
blk-flush.c blk-flush: move the queue kick into
blk-integrity.c block: add export.h to files using EXPORT_SYMBOL/THIS_MODULE macros
blk-ioc.c block: fix ioc leak in put_io_context
blk-iopoll.c tree-wide: fix assorted typos all over the place
blk-lib.c block: add cond_resched() to potentially long running ioctl discard loop
blk-map.c block: re-use existing 'reading' variable instead of checking direction again
blk-merge.c block: separate out blk_rq_merge_ok() and blk_try_merge() from elevator functions
blk-settings.c block: properly stack underlying max_segment_size to DM device
blk-softirq.c sched, block: Unify cache detection
blk-sysfs.c block: avoid using uninitialized value in from queue_var_store
blk-tag.c block: fix blk_queue_end_tag()
blk-throttle.c block: use lockdep_assert_held for queue locking
blk-timeout.c block: fix race between request completion and timeout handling
blk.h Merge branch 'linus' into sched/core
bsg-lib.c block: Change module.h -> export.h in bsg-lib.c
bsg.c bsg: fix sysfs link remove warning
cfq-iosched.c block: Make cfq_target_latency tunable through sysfs.
cfq.h
compat_ioctl.c
deadline-iosched.c
elevator.c
genhd.c
ioctl.c
noop-iosched.c
partition-generic.c
scsi_ioctl.c