android_kernel_xiaomi_sm7250/Documentation
Dave Rodgman a12af21644 lib/lzo: implement run-length encoding
Patch series "lib/lzo: run-length encoding support", v5.

Following on from the previous lzo-rle patchset:

  https://lkml.org/lkml/2018/11/30/972

This patchset contains only the RLE patches, and should be applied on
top of the non-RLE patches ( https://lkml.org/lkml/2019/2/5/366 ).

Previously, some questions were raised around the RLE patches.  I've
done some additional benchmarking to answer these questions.  In short:

 - RLE offers significant additional performance (data-dependent)

 - I didn't measure any regressions that were clearly outside the noise

One concern with this patchset was around performance - specifically,
measuring RLE impact separately from Matt Sealey's patches (CTZ & fast
copy).  I have done some additional benchmarking which I hope clarifies
the benefits of each part of the patchset.

Firstly, I've captured some memory via /dev/fmem from a Chromebook with
many tabs open which is starting to swap, and then split this into 4178
4k pages.  I've excluded the all-zero pages (as zram does), and also the
no-zero pages (which won't tell us anything about RLE performance).
This should give a realistic test dataset for zram.  What I found was
that the data is VERY bimodal: 44% of pages in this dataset contain 5%
or fewer zeros, and 44% contain over 90% zeros (30% if you include the
no-zero pages).  This supports the idea of special-casing zeros in zram.

Next, I've benchmarked four variants of lzo on these pages (on 64-bit
Arm at max frequency): baseline LZO; baseline + Matt Sealey's patches
(aka MS); baseline + RLE only; baseline + MS + RLE.  Numbers are for
weighted roundtrip throughput (the weighting reflects that zram does
more compression than decompression).

  https://drive.google.com/file/d/1VLtLjRVxgUNuWFOxaGPwJYhl_hMQXpHe/view?usp=sharing

Matt's patches help in all cases for Arm (and no effect on Intel), as
expected.

RLE also behaves as expected: with few zeros present, it makes no
difference; above ~75%, it gives a good improvement (50 - 300 MB/s on
top of the benefit from Matt's patches).

Best performance is seen with both MS and RLE patches.

Finally, I have benchmarked the same dataset on an x86-64 device.  Here,
the MS patches make no difference (as expected); RLE helps, similarly as
on Arm.  There were no definite regressions; allowing for observational
error, 0.1% (3/4178) of cases had a regression > 1 standard deviation,
of which the largest was 4.6% (1.2 standard deviations).  I think this
is probably within the noise.

  https://drive.google.com/file/d/1xCUVwmiGD0heEMx5gcVEmLBI4eLaageV/view?usp=sharing

One point to note is that the graphs show RLE appears to help very
slightly with no zeros present! This is because the extra code causes
the clang optimiser to change code layout in a way that happens to have
a significant benefit.  Taking baseline LZO and adding a do-nothing line
like "__builtin_prefetch(out_len);" immediately before the "goto next"
has the same effect.  So this is a real, but basically spurious effect -
it's small enough not to upset the overall findings.

This patch (of 3):

When using zram, we frequently encounter long runs of zero bytes.  This
adds a special case which identifies runs of zeros and encodes them
using run-length encoding.

This is faster for both compression and decompresion.  For high-entropy
data which doesn't hit this case, impact is minimal.

Compression ratio is within a few percent in all cases.

This modifies the bitstream in a way which is backwards compatible
(i.e., we can decompress old bitstreams, but old versions of lzo cannot
decompress new bitstreams).

Link: http://lkml.kernel.org/r/20190205155944.16007-2-dave.rodgman@arm.com
Signed-off-by: Dave Rodgman <dave.rodgman@arm.com>
Cc: David S. Miller <davem@davemloft.net>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Markus F.X.J. Oberhumer <markus@oberhumer.com>
Cc: Matt Sealey <matt.sealey@arm.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Nitin Gupta <nitingupta910@gmail.com>
Cc: Richard Purdie <rpurdie@openedhand.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Cc: Sonny Rao <sonnyrao@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: UtsavBalar1231 <utsavbalar1231@gmail.com>
2022-11-12 11:19:24 +00:00
..
ABI Merge branch 'linux-4.19.y' of https://github.com/jaegeuk/f2fs-stable into skizo-x 2022-11-12 11:18:36 +00:00
accelerators
accounting FROMLIST: psi: introduce psi monitor 2019-03-22 23:07:14 +00:00
acpi
admin-guide Merge remote-tracking branch 'aosp/android-4.19-stable' into android12-base 2022-09-22 14:02:10 +05:30
aoe
arm msm: rdbg: Add snapshot of remote debugger driver 2019-06-08 10:30:42 +05:30
arm64 Merge branch 'android-4.19-stable' of https://github.com/aosp-mirror/kernel_common into skizo-x 2022-11-12 11:18:12 +00:00
auxdisplay
backlight
block File and metadata encryption changes from android-4.19.96-107 2020-04-21 06:19:04 -07:00
blockdev zram: make deduplication feature optional 2019-08-01 22:24:02 -07:00
bpf Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next 2018-08-07 11:02:05 -07:00
bus-devices
cdrom
cgroup-v1
cma
connector
console Documentation: corrections to console/console.txt 2018-08-10 16:09:40 -06:00
core-api UPSTREAM: timekeeping: Boot should be boottime for coarse ns accessor 2020-10-25 11:48:11 +01:00
cpu-freq
cpuidle
crypto Revert existing FBE changes for ICE FBE 2020-04-24 15:19:09 -07:00
dev-tools UPSTREAM: kcov: fix struct layout for kcov_remote_arg 2020-01-15 14:52:07 +00:00
device-mapper Merge tag 'ASB-2021-02-05_4.19-stable' of https://github.com/aosp-mirror/kernel_common into android12-base 2022-02-26 15:02:59 +05:30
devicetree This is the 4.19.262 stable release 2022-10-30 16:23:17 +01:00
doc-guide
driver-api Merge android-4.19-stable.149 (9ce79d9) into msm-4.19 2020-10-21 09:25:49 +05:30
driver-model FROMGIT: docs: driver-model: Add documentation for sync_state 2019-10-24 14:23:14 -07:00
early-userspace initramfs: move gen_initramfs_list.sh from scripts/ to usr/ 2018-08-22 23:21:44 +09:00
EDID
extcon
fault-injection
fb uvesafb: Fix URLs in the documentation 2018-09-26 18:11:23 +02:00
features
filesystems Merge branch 'linux-4.19.y' of https://github.com/jaegeuk/f2fs-stable into skizo-x 2022-11-12 11:18:36 +00:00
firmware_class
fmc
fpga
gpio
gpu drm/msm/gpu: Add the buffer objects from the submit to the crash dump 2018-07-30 08:50:10 -04:00
hid HID: doc: fix wrong data structure reference for UHID_OUTPUT 2019-12-05 09:20:36 +01:00
hwmon UPSTREAM: Revert "hwmon: Make chip parameter for with_info API mandatory" 2022-06-29 16:31:58 -07:00
i2c i2c: i801: Add support for Intel Comet Lake 2019-05-04 09:20:15 +02:00
ia64
ide
iio
infiniband
input Input: iforce - add support for Boeder Force Feedback Wheel 2022-09-20 12:26:48 +02:00
ioctl Char/Misc driver patches for 4.19-rc1 2018-08-18 11:04:51 -07:00
isdn
kbuild kbuild: support LLVM=1 to switch the default tools to Clang/LLVM 2020-09-26 18:01:32 +02:00
kdump
kernel-hacking doc:it_IT: translation for kernel-hacking 2018-07-26 16:21:09 -06:00
laptops
leds
lightnvm
livepatch
locking
m68k
maintainer
md
media This is the 4.19.155 stable release 2020-11-05 14:02:27 +01:00
memory-devices
mic
mips
misc-devices
mmc Revert "mmc: driver's changes from kernel msm-4.14 to msm-4.19" 2019-05-13 13:12:22 +05:30
mtd
namespaces
netlabel
networking Merge remote-tracking branch 'aosp/android-4.19-stable' into android12-base 2022-08-12 20:54:07 +05:30
nfc
nios2
nvdimm
nvmem
openrisc
parisc
PCI Merge branch 'remotes/lorenzo/pci/dwc' 2018-08-15 14:59:11 -05:00
pcmcia pcmcia: remove long deprecated pcmcia_request_exclusive_irq() function 2018-08-18 12:30:42 -07:00
perf perf: add qcom l2 cache perf events driver 2019-12-26 12:45:54 +05:30
phy
platform
power ANDROID: GKI: QoS: Enhance framework to support cpu/irq specific QoS requests 2020-04-08 16:37:25 +00:00
powerpc
pps
process docs: update mediator information in CoC docs 2022-10-26 13:19:16 +02:00
pti
ptp
rapidio
RCU
riscv
s390
scheduler ANDROID: sched/tune: Move SchedTune cpu API into UtilClamp wrappers 2020-02-01 15:03:17 +00:00
scsi scsi: documentation: add scsi_mod.use_blk_mq to scsi-parameters 2018-08-27 12:26:10 -04:00
security
serial
sh
sound This is the 4.19.116 stable release 2020-04-18 13:33:51 +02:00
sparc
sphinx tweewide: Fix most Shebang lines 2021-05-22 10:59:50 +02:00
sphinx-static
spi
sysctl Merge remote-tracking branch 'aosp/android-4.19-stable' into android12-base 2022-07-09 10:34:17 +05:30
target tweewide: Fix most Shebang lines 2021-05-22 10:59:50 +02:00
thermal
timers
trace tracing/histogram: Rename "cpu" to "common_cpu" 2021-08-12 13:19:42 +02:00
translations This was a moderately busy cycle for docs, with the usual collection of 2018-08-14 14:29:31 -07:00
usb UPSTREAM: usb: raw-gadget: documentation updates 2020-06-01 22:15:34 +02:00
userspace-api Documentation: Add section about CPU vulnerabilities for Spectre 2019-07-14 08:11:17 +02:00
virtual KVM: X86: MMU: Use the correct inherited permissions to get shadow page 2021-08-15 13:05:04 +02:00
vm mm/slub: clarify verification reporting 2021-06-30 08:48:26 -04:00
w1
watchdog
wimax
x86 x86/speculation/taa: Add documentation for TSX Async Abort 2019-11-12 19:21:34 +01:00
xtensa
.gitignore
00-INDEX
atomic_bitops.txt locking/atomic: Make test_and_*_bit() ordered on failure 2022-08-25 11:15:42 +02:00
atomic_t.txt x86/atomic: Fix smp_mb__{before,after}_atomic() 2019-07-26 09:14:08 +02:00
bt8xxgpio.txt
btmrvl.txt
bus-virt-phys-mapping.txt
Changes
clearing-warn-once.txt
CodingStyle
conf.py docs/conf.py: Cope with removal of language=None in Sphinx 5.0.0 2022-06-14 16:59:30 +02:00
cpu-load.txt
cputopology.txt
crc32.txt
dcdbas.txt
debugging-modules.txt
debugging-via-ohci1394.txt
dell_rbu.txt
digsig.txt
DMA-API-HOWTO.txt
DMA-API.txt
DMA-attributes.txt Reinstate some of "swiotlb: rework "fix info leak with DMA_FROM_DEVICE"" 2022-05-25 09:10:41 +02:00
DMA-ISA-LPC.txt
docutils.conf
dontdiff unicode: refactor the rule for regenerating utf8data.h 2019-09-23 13:23:29 -07:00
efi-stub.txt
eisa.txt
flexible-arrays.txt
futex-requeue-pi.txt
gcc-plugins.txt
highuid.txt
hw_random.txt
hwspinlock.txt
index.rst x86/speculation/mds: Add mds_clear_cpu_buffers() 2019-05-14 19:17:54 +02:00
intel_txt.txt
Intel-IOMMU.txt
io_ordering.txt
io-mapping.txt
iostats.txt
IPMI.txt
IRQ-affinity.txt
IRQ-domain.txt
IRQ.txt
irqflags-tracing.txt
isa.txt
isapnp.txt
kernel-per-CPU-kthreads.txt
kobject.txt
kprobes.txt
kref.txt
ldm.txt
lockup-watchdogs.txt
logo.gif
logo.txt
lsm.txt
lzo.txt lib/lzo: implement run-length encoding 2022-11-12 11:19:24 +00:00
mailbox.txt
Makefile
memory-barriers.txt
memory-hotplug.txt
men-chameleon-bus.txt
mhi.txt mhi: add snapshot for MHI driver stack 2018-09-13 13:00:59 -07:00
nommu-mmap.txt
ntb.txt
numastat.txt
padata.txt
parport-lowlevel.txt
percpu-rw-semaphore.txt
phy.txt
pi-futex.txt
pnp.txt
preempt-locking.txt
pwm.txt
rbtree.txt
remoteproc.txt
rfkill.txt
robust-futex-ABI.txt
robust-futexes.txt futex: Update comments and docs about return values of arch futex code 2019-07-03 13:14:49 +02:00
rpmsg.txt
rtc.txt
SAK.txt
sgi-ioc4.txt
siphash.txt
SM501.txt
smsc_ece1099.txt
speculation.txt
static-keys.txt
SubmittingPatches
svga.txt
switchtec.txt
sync_file.txt
tee.txt
this_cpu_ops.txt
unaligned-memory-access.txt
vfio-mediated-device.txt
vfio.txt
video-output.txt
xillybus.txt
xz.txt
zorro.txt