Files
kernel/include/linux
Dennis Zhou 13369816cb block: fix blk-iolatency accounting underflow
The blk-iolatency controller measures the time from rq_qos_throttle() to
rq_qos_done_bio() and attributes this time to the first bio that needs
to create the request. This means if a bio is plug-mergeable or
bio-mergeable, it gets to bypass the blk-iolatency controller.

The recent series [1], to tag all bios w/ blkgs undermined how iolatency
was determining which bios it was charging and should process in
rq_qos_done_bio(). Because all bios are being tagged, this caused the
atomic_t for the struct rq_wait inflight count to underflow and result
in a stall.

This patch adds a new flag BIO_TRACKED to let controllers know that a
bio is going through the rq_qos path. blk-iolatency now checks if this
flag is set to see if it should process the bio in rq_qos_done_bio().

Overloading BLK_QUEUE_ENTERED works, but makes the flag rules confusing.
BIO_THROTTLED was another candidate, but the flag is set for all bios
that have gone through blk-throttle code. Overloading a flag comes with
the burden of making sure that when either implementation changes, a
change in setting rules for one doesn't cause a bug in the other. So
here, we unfortunately opt for adding a new flag.

[1] https://lore.kernel.org/lkml/20181205171039.73066-1-dennis@kernel.org/

Fixes: 5cdf2e3fea ("blkcg: associate blkg when associating a device")
Signed-off-by: Dennis Zhou <dennis@kernel.org>
Cc: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2018-12-17 11:19:54 -07:00
..
2018-10-31 10:57:43 -07:00
2018-10-18 15:41:21 -07:00
2018-10-16 11:13:50 +02:00
2018-10-31 19:24:21 +01:00
2018-12-07 22:26:38 -07:00
2018-11-07 13:44:59 -07:00
2018-11-07 13:44:59 -07:00
2018-12-16 19:53:47 -07:00
2018-10-19 13:24:31 -07:00
2018-10-19 13:24:31 -07:00
2018-10-26 16:26:32 -07:00
2018-11-19 19:03:50 -07:00
2018-11-10 08:03:52 -07:00
2018-10-21 10:46:33 -04:00
2018-11-07 13:42:32 -07:00
2018-11-19 19:03:46 -07:00
2018-10-31 08:54:14 -07:00
2018-10-17 13:56:58 -07:00
2018-12-13 09:58:57 +01:00
2018-10-21 10:46:39 -04:00
2018-10-26 16:26:35 -07:00
2018-10-08 22:53:10 +11:00
2018-12-03 17:03:58 -07:00
2018-10-11 09:16:44 -07:00
2018-11-05 16:38:10 -05:00