android_kernel_samsung_msm8976/arch
Lorenzo Pieralisi d6e30a2883 ARM: 7919/1: mm: refactor v7 cache cleaning ops to use way/index sequence
Set-associative caches on all v7 implementations map the index bits
to physical addresses LSBs and tag bits to MSBs. As the last level
of cache on current and upcoming ARM systems grows in size,
this means that under normal DRAM controller configurations, the
current v7 cache flush routine using set/way operations triggers a
DRAM memory controller precharge/activate for every cache line
writeback since the cache routine cleans lines by first fixing the
index and then looping through ways (index bits are mapped to lower
physical addresses on all v7 cache implementations; this means that,
with last level cache sizes in the order of MBytes, lines belonging
to the same set but different ways map to different DRAM pages).

Given the random content of cache tags, swapping the order between
indexes and ways loops do not prevent DRAM pages precharge and
activate cycles but at least, on average, improves the chances that
either multiple lines hit the same page or multiple lines belong to
different DRAM banks, improving throughput significantly.

This patch swaps the inner loops in the v7 cache flushing routine
to carry out the clean operations first on all sets belonging to
a given way (looping through sets) and then decrementing the way.

Benchmarks showed that by swapping the ordering in which sets and
ways are decremented in the v7 cache flushing routine, that uses
set/way operations, time required to flush caches is reduced
significantly, owing to improved writebacks throughput to the DRAM
controller.

Benchmarks results vary and depend heavily on the last level of
cache tag RAM content when cache is cleaned and invalidated, ranging
from 2x throughput when all tag RAM entries contain dirty lines
mapping to sequential pages of RAM to 1x (ie no improvement) when
all tag RAM accesses trigger a DRAM precharge/activate cycle, as the
current code implies on most DRAM controller configurations.

Acked-by: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Nicolas Pitre <nico@linaro.org>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Reviewed-by: Dave Martin <Dave.Martin@arm.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
2019-07-27 21:53:24 +02:00
..
alpha Safer ABI for O_TMPFILE 2018-12-03 11:52:36 +01:00
arc mm: larger stack guard gap, between vmas 2017-07-11 00:00:39 +00:00
arm ARM: 7919/1: mm: refactor v7 cache cleaning ops to use way/index sequence 2019-07-27 21:53:24 +02:00
arm64 defconfig: Disable LTE coexistence for wifi only models 2019-07-27 21:51:32 +02:00
avr32
blackfin
c6x
cris
frv mm: larger stack guard gap, between vmas 2017-07-11 00:00:39 +00:00
h8300
hexagon
ia64 Import latest Samsung release 2017-04-18 03:43:52 +02:00
m32r This is the 3.10.98 stable release 2017-04-18 17:17:24 +02:00
m68k Merge remote-tracking branch 'f2fs/linux-3.10.y' into HEAD 2017-04-18 17:02:28 +02:00
metag
microblaze
mips mm: larger stack guard gap, between vmas 2017-07-11 00:00:39 +00:00
mn10300 This is the 3.10.96 stable release 2017-04-18 17:16:02 +02:00
openrisc This is the 3.10.96 stable release 2017-04-18 17:16:02 +02:00
parisc Safer ABI for O_TMPFILE 2018-12-03 11:52:36 +01:00
powerpc mm: larger stack guard gap, between vmas 2017-07-11 00:00:39 +00:00
s390 kernel: make groups_sort calling a responsibility group_info allocators 2019-07-27 21:46:18 +02:00
score
sh mm: larger stack guard gap, between vmas 2017-07-11 00:00:39 +00:00
sparc crypto: hash - annotate algorithms taking optional key 2019-07-27 21:49:17 +02:00
tile mm: larger stack guard gap, between vmas 2017-07-11 00:00:39 +00:00
um This is the 3.10.99 stable release 2017-04-18 17:17:46 +02:00
unicore32
x86 x86/acpi: Prevent out of bound access caused by broken ACPI tables 2019-07-27 21:51:30 +02:00
xtensa mm: larger stack guard gap, between vmas 2017-07-11 00:00:39 +00:00
.gitignore
Kconfig