android_kernel_msm-6.1_noth.../block
Qais Yousef bfacfd198e UPSTREAM: block/blk-mq: Don't complete locally if capacities are different
The logic in blk_mq_complete_need_ipi() assumes SMP systems where all
CPUs have equal compute capacities and only LLC cache can make
a different on perceived performance. But this assumption falls apart on
HMP systems where LLC is shared, but the CPUs have different capacities.
Staying local then can have a big performance impact if the IO request
was done from a CPU with higher capacity but the interrupt is serviced
on a lower capacity CPU.

Use the new cpus_equal_capacity() function to check if we need to send
an IPI.

Without the patch I see the BLOCK softirq always running on little cores
(where the hardirq is serviced). With it I can see it running on all
cores.

This was noticed after the topology change [1] where now on a big.LITTLE
we truly get that the LLC is shared between all cores where as in the
past it was being misrepresented for historical reasons. The logic
exposed a missing dependency on capacities for such systems where there
can be a big performance difference between the CPUs.

This of course introduced a noticeable change in behavior depending on
how the topology is presented. Leading to regressions in some workloads
as the performance of the BLOCK softirq on littles can be noticeably
worse on some platforms.

Worth noting that we could have checked for capacities being greater
than or equal instead for equality. This will lead to favouring higher
performance always. But opted for equality instead to match the
performance of the requester without making an assumption that can lead
to power trade-offs which these systems tend to be sensitive about. If
the requester would like to run faster, it's better to rely on the
scheduler to give the IO requester via some facility to run on a faster
core; and then if the interrupt triggered on a CPU with different
capacity we'll make sure to match the performance the requester is
supposed to run at.

[1] https://lpc.events/event/16/contributions/1342/attachments/962/1883/LPC-2022-Android-MC-Phantom-Domains.pdf

Bug: 341551538
Signed-off-by: Qais Yousef <qyousef@layalina.io>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Link: https://lore.kernel.org/r/20240223155749.2958009-3-qyousef@layalina.io
Signed-off-by: Jens Axboe <axboe@kernel.dk>
(cherry picked from commit af550e4c968294398fc76b075f12d51c76caf753)
Signed-off-by: Qais Yousef <qyousef@google.com>
(cherry picked from https://android-review.googlesource.com/q/commit:d01dc1c7d020f49f31194254a89694bd23ad3dd5)
Merged-In: Iefed6a19b9d25102642e264118431f5e12e23fea
Change-Id: Iefed6a19b9d25102642e264118431f5e12e23fea
2024-06-06 15:43:07 +00:00
..
partitions block: Move checking GENHD_FL_NO_PART to bdev_add_partition() 2024-01-31 16:17:11 -08:00
badblocks.c
bdev.c Reapply "Merge tag 'android14-6.1.75_r00' into android14-6.1" 2024-04-02 19:49:12 +00:00
bfq-cgroup.c block, bfq: fix uaf for bfqq in bic_set_bfqq() 2023-02-09 11:28:06 +01:00
bfq-iosched.c block, bfq: Fix division by zero error on zero wsum 2023-05-24 17:32:38 +01:00
bfq-iosched.h
bfq-wf2q.c
bio-integrity.c block: factor out a bvec_set_page helper 2023-09-23 11:11:08 +02:00
bio.c Merge 6.1.77 into android14-6.1-lts 2024-04-17 08:34:35 +00:00
blk-cgroup-fc-appid.c
blk-cgroup-rwstat.c
blk-cgroup-rwstat.h
blk-cgroup.c Reapply "Merge tag 'android14-6.1.75_r00' into android14-6.1" 2024-04-02 19:49:12 +00:00
blk-cgroup.h
blk-core.c Merge 6.1.78 into android14-6.1-lts 2024-04-19 12:19:39 +00:00
blk-crypto-fallback.c Merge 6.1.47 into android14-6.1-lts 2023-09-13 19:35:46 +00:00
blk-crypto-internal.h blk-mq: release crypto keyslot before reporting I/O complete 2023-05-11 23:03:00 +09:00
blk-crypto-profile.c BACKPORT: blk-crypto: use dynamic lock class for blk_crypto_profile::lock 2023-07-27 00:02:13 +00:00
blk-crypto-sysfs.c blk-crypto: pass a gendisk to blk_crypto_sysfs_{,un}register 2022-12-22 10:48:11 -08:00
blk-crypto.c blk-crypto: make blk_crypto_evict_key() more robust 2023-05-11 23:03:01 +09:00
blk-flush.c
blk-ia-ranges.c
blk-integrity.c
blk-ioc.c UPSTREAM: blk-ioc: fix recursive spin_lock/unlock_irq() in ioc_clear_queue() 2023-09-06 07:41:45 +00:00
blk-iocost.c blk-iocost: Fix an UBSAN shift-out-of-bounds warning 2024-02-16 19:06:29 +01:00
blk-iolatency.c
blk-ioprio.c UPSTREAM: blk-ioprio: Introduce promote-to-rt policy 2023-09-29 09:18:05 +00:00
blk-ioprio.h
blk-lib.c
blk-map.c ANDROID: block: Support submitting passthrough requests with small segments 2024-03-20 23:00:23 +00:00
blk-merge.c Reapply "ANDROID: block: Add support for filesystem requests and small segments" 2024-04-17 18:38:54 +00:00
blk-mq-cpumap.c
blk-mq-debugfs-zoned.c
blk-mq-debugfs.c ANDROID: block: Make sub_page_limit_queues available in debugfs 2024-03-20 23:00:23 +00:00
blk-mq-debugfs.h ANDROID: block: Make sub_page_limit_queues available in debugfs 2024-03-20 23:00:23 +00:00
blk-mq-pci.c
blk-mq-rdma.c
blk-mq-sched.c blk-mq: correct stale comment of .get_budget 2023-03-10 09:32:44 +01:00
blk-mq-sched.h
blk-mq-sysfs.c blk-mq: fix possible memleak when register 'hctx' failed 2022-12-31 13:33:03 +01:00
blk-mq-tag.c Revert "blk-mq: fix potential io hang by wrong 'wake_batch'" 2023-09-05 10:47:44 +00:00
blk-mq-tag.h
blk-mq-virtio.c
blk-mq.c UPSTREAM: block/blk-mq: Don't complete locally if capacities are different 2024-06-06 15:43:07 +00:00
blk-mq.h blk-mq: fix potential io hang by wrong 'wake_batch' 2023-07-19 16:20:55 +02:00
blk-pm.c
blk-pm.h
blk-rq-qos.c
blk-rq-qos.h
blk-settings.c Reapply "Merge tag 'android14-6.1.75_r00' into android14-6.1" 2024-04-02 19:49:12 +00:00
blk-stat.c blk-stat: fix QUEUE_FLAG_STATS clear 2023-05-11 23:03:00 +09:00
blk-stat.h
blk-sysfs.c ANDROID: block: Support configuring limits below the page size 2024-03-20 23:00:23 +00:00
blk-throttle.c Reapply "Merge tag 'android14-6.1.75_r00' into android14-6.1" 2024-04-02 19:49:12 +00:00
blk-throttle.h
blk-timeout.c
blk-wbt.c
blk-wbt.h
blk-zoned.c
blk.h Reapply "ANDROID: block: Add support for filesystem requests and small segments" 2024-04-17 18:38:54 +00:00
bounce.c
bsg-lib.c FROMGIT: blk-mq: move the call to blk_put_queue out of blk_mq_destroy_queue 2023-02-23 17:09:21 +00:00
bsg.c
disk-events.c block: increment diskseq on all media change events 2023-07-19 16:21:47 +02:00
elevator.c
elevator.h ANDROID: GKI: elevator: add Android ABI padding to some structures 2023-06-07 14:24:56 +00:00
fops.c Reapply "Merge tag 'android14-6.1.75_r00' into android14-6.1" 2024-04-02 19:49:12 +00:00
genhd.c Reapply "Merge tag 'android14-6.1.75_r00' into android14-6.1" 2024-04-02 19:49:12 +00:00
holder.c
ioctl.c Reapply "Merge tag 'android14-6.1.75_r00' into android14-6.1" 2024-04-02 19:49:12 +00:00
ioprio.c
Kconfig
Kconfig.iosched
kyber-iosched.c
Makefile
mq-deadline.c block/mq-deadline: use correct way to throttling write requests 2023-09-13 09:42:42 +02:00
opal_proto.h
sed-opal.c
t10-pi.c