kernel_samsung_a53x/block
Yu Kuai 25901091f1 block, bfq: don't break merge chain in bfq_split_bfqq()
[ Upstream commit 42c306ed723321af4003b2a41bb73728cab54f85 ]

Consider the following scenario:

    Process 1       Process 2       Process 3       Process 4
     (BIC1)          (BIC2)          (BIC3)          (BIC4)
      Λ               |               |                |
       \-------------\ \-------------\ \--------------\|
                      V               V                V
      bfqq1--------->bfqq2---------->bfqq3----------->bfqq4
ref    0              1               2                4

If Process 1 issue a new IO and bfqq2 is found, and then bfq_init_rq()
decide to spilt bfqq2 by bfq_split_bfqq(). Howerver, procress reference
of bfqq2 is 1 and bfq_split_bfqq() just clear the coop flag, which will
break the merge chain.

Expected result: caller will allocate a new bfqq for BIC1

    Process 1       Process 2       Process 3       Process 4
     (BIC1)          (BIC2)          (BIC3)          (BIC4)
                      |               |                |
                       \-------------\ \--------------\|
                                      V                V
      bfqq1--------->bfqq2---------->bfqq3----------->bfqq4
ref    0              0               1                3

Since the condition is only used for the last bfqq4 when the previous
bfqq2 and bfqq3 are already splited. Fix the problem by checking if
bfqq is the last one in the merge chain as well.

Fixes: 36eca8948323 ("block, bfq: add Early Queue Merge (EQM)")
Signed-off-by: Yu Kuai <yukuai3@huawei.com>
Link: https://lore.kernel.org/r/20240902130329.3787024-4-yukuai1@huaweicloud.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-11-23 23:21:19 +01:00
..
partitions Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
badblocks.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfq-cgroup.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bfq-iosched.c block, bfq: don't break merge chain in bfq_split_bfqq() 2024-11-23 23:21:19 +01:00
bfq-iosched.h block, bfq: save also injection state on queue merging 2024-11-19 17:43:15 +01:00
bfq-wf2q.c block, bfq: always inject I/O of queues blocked by wakers 2024-11-19 17:41:42 +01:00
bio-integrity.c block: initialize integrity buffer to zero before writing it to media 2024-11-23 23:20:59 +01:00
bio.c block: prevent an integer overflow in bvec_try_merge_hw_page 2024-11-18 12:13:14 +01:00
blk-cgroup-rwstat.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
blk-cgroup-rwstat.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
blk-cgroup.c cgroup: rstat: punt root-level optimization to individual controllers 2024-11-19 17:40:21 +01:00
blk-core.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
blk-crypto-fallback.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
blk-crypto-internal.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
blk-crypto.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
blk-exec.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
blk-flush.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
blk-integrity.c block: remove the blk_flush_integrity call in blk_integrity_unregister 2024-11-23 23:20:58 +01:00
blk-ioc.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
blk-iocost.c blk-iocost: avoid out of bounds shift 2024-11-19 11:32:44 +01:00
blk-iolatency.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
blk-ioprio.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
blk-ioprio.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
blk-lib.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
blk-map.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
blk-merge.c blk: Fix lock inversion between ioc lock and bfqd lock 2024-11-19 17:40:26 +01:00
blk-mq-cpumap.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
blk-mq-debugfs-zoned.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
blk-mq-debugfs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
blk-mq-debugfs.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
blk-mq-pci.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
blk-mq-rdma.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
blk-mq-sched.c blk: Fix lock inversion between ioc lock and bfqd lock 2024-11-19 17:40:26 +01:00
blk-mq-sched.h blk: Fix lock inversion between ioc lock and bfqd lock 2024-11-19 17:40:26 +01:00
blk-mq-sysfs.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
blk-mq-tag.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
blk-mq-tag.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
blk-mq-virtio.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
blk-mq.c blk-mq: fix IO hang from sbitmap wakeup race 2024-11-18 12:13:20 +01:00
blk-mq.h blk: Fix lock inversion between ioc lock and bfqd lock 2024-11-19 17:40:26 +01:00
blk-pm.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
blk-pm.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
blk-rq-qos.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
blk-rq-qos.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
blk-sec-stats.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
blk-settings.c block: Clear zone limits for a non-zoned stacked queue 2024-11-19 09:22:16 +01:00
blk-stat.c block: prevent division by zero in blk_rq_stat_sum() 2024-11-19 09:23:14 +01:00
blk-stat.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
blk-sysfs.c Revert "mm: apply init protection" 2024-11-19 18:15:13 +01:00
blk-throttle.c blk-throttle: fix lockdep warning of "cgroup_mutex or RCU read lock required!" 2024-11-18 12:11:56 +01:00
blk-timeout.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
blk-wbt.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
blk-wbt.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
blk-zoned.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
blk.h blk: Fix lock inversion between ioc lock and bfqd lock 2024-11-19 17:40:26 +01:00
bounce.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bsg-lib.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
bsg.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
cmdline-parser.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
elevator.c block: Add default I/O scheduler option 2024-11-19 17:43:55 +01:00
genhd.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ioctl.c block/ioctl: prefer different overflow check 2024-11-19 14:19:06 +01:00
ioprio.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Kconfig.iosched block: Add default I/O scheduler option 2024-11-19 17:43:55 +01:00
keyslot-manager.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
kyber-iosched.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mq-deadline-cgroup.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mq-deadline-cgroup.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
mq-deadline-main.c blk: Fix lock inversion between ioc lock and bfqd lock 2024-11-19 17:40:26 +01:00
opal_proto.h block: sed-opal: handle empty atoms when parsing response 2024-11-19 08:44:36 +01:00
scsi_ioctl.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
sed-opal.c block: sed-opal: handle empty atoms when parsing response 2024-11-19 08:44:36 +01:00
ssg-cgroup.c ssg: Set max available ratio to 25 2024-11-17 17:41:50 +01:00
ssg-cgroup.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
ssg-iosched.c block: ssg-iosched: adapt to new patches 2024-11-19 17:40:09 +01:00
t10-pi.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00