android_kernel_samsung_msm8226/block
Diogo Ferreira d53b0a7b16 bfq-sched: Forcefully lookup entities when the cache is inconsistent
bfq maintains a 'next-in-service' cache to prevent expensive lookups in
the hot path. However, the cache sometimes becomes inconsistent and
triggers a BUG:

[44042.622839] -(3)[154:mmcqd/0]BUG: failure at ../../../../../../kernel/cyanogen/mt6735/block/bfq-sched.c:72/bfq_check_next_in_service()!
[44042.622858] -(3)[154:mmcqd/0]Unable to handle kernel paging request at virtual address 0000dead
[44042.622866] -(3)[154:mmcqd/0]pgd = ffffffc001361000
[44042.622872] [0000dead] *pgd=000000007d816003, *pud=000000007d816003, *pmd=000000007d817003, *pte=0000000000000000
[44042.622890] -(3)[154:mmcqd/0]Internal error: Oops: 96000045 [#1] PREEMPT SMP
[44042.622907] -(3)[154:mmcqd/0]CPU: 3 PID: 154 Comm: mmcqd/0 Tainted:
[44042.622915] -(3)[154:mmcqd/0]Hardware name: MT6735 (DT)
[44042.622922] -(3)[154:mmcqd/0]task: ffffffc0378a6000 ti: ffffffc0378c4000
[44042.622936] -(3)[154:mmcqd/0]PC is at bfq_dispatch_requests+0x6c4/0x9bc
[44042.622944] -(3)[154:mmcqd/0]LR is at bfq_dispatch_requests+0x6bc/0x9bc
[44042.622952] -(3)[154:mmcqd/0]pc : [<ffffffc000306a68>] lr : [<ffffffc000306a60>] pstate: 800001c5
[44042.622958] -(3)[154:mmcqd/0]sp : ffffffc0378c7d30
[44042.622962] x29: ffffffc0378c7d30 x28: 0000000000000000
[44042.622972] x27: 0000000000000000 x26: ffffffc006c58810
[44042.622981] x25: ffffffc037f89820 x24: ffffffc000f14000
[44042.622990] x23: ffffffc036adb088 x22: ffffffc0369b2800
[44042.623000] x21: ffffffc036adb098 x20: ffffffc01d6a3b60
[44042.623009] x19: ffffffc036adb0c8 x18: 0000007f8cfa1500
[44042.623018] x17: 0000007f8db44f40 x16: ffffffc00012d0c0
[44042.623027] x15: 0000007f8dde04d8 x14: 676f6e6179632f6c
[44042.623037] x13: 656e72656b2f2e2e x12: 2f2e2e2f2e2e2f2e
[44042.623046] x11: 2e2f2e2e2f2e2e20 x10: 7461206572756c69
[44042.623055] x9 : 6166203a4755425d x8 : 00000000001f0cc5
[44042.623064] x7 : ffffffc000f3d5a0 x6 : 000000000000008b
[44042.623073] x5 : 0000000000000000 x4 : 0000000000000004
[44042.623082] x3 : 0000000000000002 x2 : 0000000000000001
[44042.623091] x1 : 0000000000000aee x0 : 000000000000dead

This patch makes the lookup resilient to cache inconsistencies by doing
the expensive recomputation in cases where the bug would otherwise be
triggered.

Ticket: PORRDIGE-527

Change-Id: I5dd701960057983a42d3d3bd57521e8d17c03d7f
Signed-off-by: Kevin F. Haggerty <haggertk@lineageos.org>
2019-08-08 12:19:56 +02:00
..
partitions Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
Kconfig misc: Import SM-G900H kernel source code 2019-08-02 15:14:10 +02:00
Kconfig.iosched block: cgroups, kconfig, build bits for BFQ-v7r8-3.4 2019-08-08 12:19:54 +02:00
Makefile block: cgroups, kconfig, build bits for BFQ-v7r8-3.4 2019-08-08 12:19:54 +02:00
bfq-cgroup.c block: introduce the BFQ-v7r8 I/O sched for 3.4 2019-08-08 12:19:55 +02:00
bfq-ioc.c block: introduce the BFQ-v7r8 I/O sched for 3.4 2019-08-08 12:19:55 +02:00
bfq-iosched.c block, bfq: add Early Queue Merge (EQM) to BFQ-v7r8 for 3.4.0 2019-08-08 12:19:55 +02:00
bfq-sched.c bfq-sched: Forcefully lookup entities when the cache is inconsistent 2019-08-08 12:19:56 +02:00
bfq.h block, bfq: add Early Queue Merge (EQM) to BFQ-v7r8 for 3.4.0 2019-08-08 12:19:55 +02:00
blk-cgroup.c Merge branch 'for-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup 2012-03-20 18:11:21 -07:00
blk-cgroup.h
blk-core.c BACKPORT: block: add blk_rq_set_block_pc() 2019-08-06 12:26:35 +02:00
blk-exec.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
blk-flush.c
blk-integrity.c
blk-ioc.c block: fix ioc leak in put_io_context 2012-03-14 15:34:48 +01:00
blk-iopoll.c
blk-lib.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
blk-map.c block: re-use existing 'reading' variable instead of checking direction again 2011-12-21 15:27:24 +01:00
blk-merge.c security: selinux: Add Per-File-Encryption hooks 2014-05-26 11:44:06 +03:00
blk-settings.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
blk-softirq.c sched, block: Unify cache detection 2012-01-27 13:28:48 +01:00
blk-sysfs.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
blk-tag.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
blk-throttle.c block: use lockdep_assert_held for queue locking 2012-03-30 12:33:28 +02:00
blk-timeout.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
blk.h block: urgent request: remove unnecessary urgent marking 2013-03-12 21:17:28 +02:00
bsg-lib.c
bsg.c BACKPORT: block: add blk_rq_set_block_pc() 2019-08-06 12:26:35 +02:00
cfq-iosched.c Revert "block: Add URGENT request notification support to CFQ scheduler" 2013-09-04 16:58:46 -07:00
cfq.h
compat_ioctl.c block: Add BLKROTATIONAL ioctl 2012-01-11 16:29:31 +01:00
deadline-iosched.c block, cfq: move icq cache management to block core 2011-12-14 00:33:42 +01:00
elevator.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
genhd.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
ioctl.c misc: Import SM-G900H kernel source code 2019-08-02 15:14:10 +02:00
noop-iosched.c block, cfq: move icq cache management to block core 2011-12-14 00:33:42 +01:00
partition-generic.c Merge tag 'v3.4.113' into lineage-16.0 2019-08-05 14:20:47 +02:00
row-iosched.c block: row: Fix crash when adding a new field in bio struct 2014-06-22 16:11:03 +03:00
scsi_ioctl.c BACKPORT: block: add blk_rq_set_block_pc() 2019-08-06 12:26:35 +02:00
test-iosched.c scsi: ufs: long sequential read/write tests 2013-07-02 15:12:24 +03:00