android_kernel_samsung_a7y1.../block
Paolo Valente 72c098e1e1 block/bfq: Consider also in_service_entity to state whether an entity is active
Groups of BFQ queues are represented by generic entities in BFQ. When
a queue belonging to a parent entity is deactivated, the parent entity
may need to be deactivated too, in case the deactivated queue was the
only active queue for the parent entity. This deactivation may need to
be propagated upwards if the entity belongs, in its turn, to a further
higher-level entity, and so on. In particular, the upward propagation
of deactivation stops at the first parent entity that remains active
even if one of its child entities has been deactivated.

To decide whether the last non-deactivation condition holds for a
parent entity, BFQ checks whether the field next_in_service is still
not NULL for the parent entity, after the deactivation of one of its
child entity. If it is not NULL, then there are certainly other active
entities in the parent entity, and deactivations can stop.

Unfortunately, this check misses a corner case: if in_service_entity
is not NULL, then next_in_service may happen to be NULL, although the
parent entity is evidently active. This happens if: 1) the entity
pointed by in_service_entity is the only active entity in the parent
entity, and 2) according to the definition of next_in_service, the
in_service_entity cannot be considered as next_in_service. See the
comments on the definition of next_in_service for details on this
second point.

Hitting the above corner case causes crashes.

To address this issue, this commit:
1) Extends the above check on only next_in_service to controlling both
next_in_service and in_service_entity (if any of them is not NULL,
then no further deactivation is performed)
2) Improves the (important) comments on how next_in_service is defined
and updated; in particular it fixes a few rather obscure paragraphs

Reported-by: Eric Wheeler <bfq-sched@lists.ewheeler.net>
Reported-by: Rick Yiu <rick_yiu@htc.com>
Reported-by: Tom X Nguyen <tom81094@gmail.com>
Signed-off-by: Paolo Valente <paolo.valente@linaro.org>
Tested-by: Eric Wheeler <bfq-sched@lists.ewheeler.net>
Tested-by: Rick Yiu <rick_yiu@htc.com>
Tested-by: Laurentiu Nicola <lnicola@dend.ro>
Tested-by: Tom X Nguyen <tom81094@gmail.com>
Signed-off-by: djb77 <dwayne.bakewell@gmail.com>
2020-04-08 11:17:15 +02:00
..
partitions A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
bfq-cgroup.c block/bfq: Update BFQ to v8r12 2020-04-08 11:17:12 +02:00
bfq-ioc.c block: introduce the BFQ-v7r11 I/O sched for 4.4.0 2020-04-08 11:17:11 +02:00
bfq-iosched.c block/bfq: Update BFQ to v8r12 2020-04-08 11:17:12 +02:00
bfq-sched.c block/bfq: Consider also in_service_entity to state whether an entity is active 2020-04-08 11:17:15 +02:00
bfq.h block/bfq: Consider also in_service_entity to state whether an entity is active 2020-04-08 11:17:15 +02:00
bio-integrity.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
bio.c block: do not leak memory in bio_copy_user_iov() 2020-04-06 15:08:22 +02:00
blk-cgroup.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
blk-core.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
blk-exec.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
blk-flush.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
blk-integrity.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
blk-ioc.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
blk-iopoll.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
blk-lib.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
blk-map.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
blk-merge.c block: don't use bio->bi_vcnt to figure out segment number 2020-04-07 13:40:31 +02:00
blk-mq-cpu.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
blk-mq-cpumap.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
blk-mq-sysfs.c blk-mq: make sure that line break can be printed 2020-04-07 13:08:08 +02:00
blk-mq-tag.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
blk-mq-tag.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
blk-mq.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
blk-mq.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
blk-settings.c block: fix an integer overflow in logical block size 2020-04-07 13:37:29 +02:00
blk-softirq.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
blk-sysfs.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
blk-tag.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
blk-throttle.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
blk-timeout.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
blk.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
bounce.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
bsg-lib.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
bsg.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
cfq-iosched.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
cmdline-parser.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
compat_ioctl.c compat_ioctl: block: handle Persistent Reservations 2020-04-07 13:24:43 +02:00
deadline-iosched.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
elevator.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
genhd.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ioctl.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
ioprio.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Kconfig A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Kconfig.iosched block: introduce the BFQ-v7r11 I/O sched for 4.4.0 2020-04-08 11:17:11 +02:00
Makefile block: cgroups, kconfig, build bits for BFQ-v7r11-4.4.0 2020-04-08 11:17:10 +02:00
noop-iosched.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
partition-generic.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
scsi_ioctl.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
t10-pi.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30