mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] block: Add done_split_bio() for chained bio post-processing
@ 2026-10-30  6:59 Li kunyu
  2026-10-30  6:59 ` [PATCH 1/2] " Li kunyu
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Li kunyu @ 2026-10-30  6:59 UTC (permalink / raw)
  To: axboe, tj, josef; +Cc: cgroups, linux-block, linux-kernel, Li kunyu

[Problems encountered]

The split-out chained bio path has a QoS accounting issue. In a complete
chained bio composed of 10 bio headers and 1 sub-bio (produced by
repeatedly splitting a large block), only the first bio header among the
10 bio headers, the one that satisfies atomic_dec_and_test(&bio->
__bi_remaining) and the single sub-bio can execute rq_qos_done_bio(bio)
to update the QoS-related accounting.

This prevents other bio headers from updating QoS-related information
such as inflight counts. The inflight counts added in
rq_qos_throttle(rq->q, bio) are not subtracted, so the inflight count in
the bio's QoS area gradually increases. As a result, it can no longer be
used as a reference value.

Reproducible scenarios are detailed below(blk-iolatency):
1. fio is used to issue at least 1024 consecutive reads or writes, each 1MB
or larger, thereby exceeding the maximum single I/O size supported by the
hardware device.

2. The 'inflight' count described in the text is observed by printing
inflight = atomic_dec_return(&rqw->inflight); in blkcg_iolatency_done_bio.


[Implementation]

patch 1:  Introduce a new abstract function 'done_split_bio' and call it
from bio_remaining_done to resolve this issue.

patch 2: Implement the blkcg_iolatency_done_split_bio callback in
blk-iolatency to correctly decrement the inflight count when the other
bio headers, which have not called rq_qos_done_bio(bio), complete.


Li kunyu (2):
  block: Add done_split_bio() for chained bio post-processing
  block/blk-iolatency: Fix inflight decrement for chained bio sub-bios

 block/bio.c               |  2 ++
 block/blk-iolatency.c     | 42 +++++++++++++++++++++++++++++++++++++++
 block/blk-merge.c         |  4 +++-
 block/blk-rq-qos.c        |  9 +++++++++
 block/blk-rq-qos.h        | 23 +++++++++++++++++++++
 include/linux/blk_types.h |  6 ++++++
 6 files changed, 85 insertions(+), 1 deletion(-)

-- 
2.47.3


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-03 10:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-30  6:59 [PATCH 0/2] block: Add done_split_bio() for chained bio post-processing Li kunyu
2026-10-30  6:59 ` [PATCH 1/2] " Li kunyu
2026-10-30  6:59 ` [PATCH 2/2] block/blk-iolatency: Fix inflight decrement for chained bio sub-bios Li kunyu
2026-11-03 10:30 ` [PATCH 0/2] block: Add done_split_bio() for chained bio post-processing Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®