android_kernel_samsung_a7y1.../drivers
carck a595e5ffcc zram: try to avoid worst-case scenario on same element pages
The worst-case scenario on finding same element pages is that almost all elements are same at the first glance but only last few elements are different.
Since the same element tends to be grouped from the beginning of the
pages, if we check the first element with the last element before
looping through all elements, we might have some chances to quickly
detect non-same element pages.

 1. Test is done under LG webOS TV (64-bit arch)
 2. Dump the swap-out pages (~819200 pages)
 3. Analyze the pages with simple test script which counts the iteration
    number and measures the speed at off-line

Under 64-bit arch, the worst iteration count is PAGE_SIZE / 8 bytes =
512.  The speed is based on the time to consume page_same_filled()
function only.  The result, on average, is listed as below:

                                     Num of Iter    Speed(MB/s)
  Looping-Forward (Orig)                 38            99265
  Looping-Backward                       36           102725
  Last-element-check (This Patch)        33           125072

The result shows that the average iteration count decreases by 13% and
the speed increases by 25% with this patch.  This patch does not
increase the overall time complexity, though.

I also ran simpler version which uses backward loop.  Just looping
backward also makes some improvement, but less than this patch.

[taejoon.song@lge.com: fix off-by-one]
  Link: http://lkml.kernel.org/r/1578642001-11765-1-git-send-email-taejoon.song@lge.com
Link: http://lkml.kernel.org/r/1575424418-16119-1-git-send-email-taejoon.song@lge.com
Signed-off-by: Taejoon Song <taejoon.song@lge.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>
Cc: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2020-08-19 11:34:40 +05:30
..
accessibility
acpi x86/mm: split vmalloc_sync_all() 2020-04-07 14:14:34 +02:00
amba
android
ata
atm atm: eni: fix uninitialized variable warning 2020-04-07 13:45:54 +02:00
auxdisplay
base power: Remove default wakelocks from boeffla_wl_blocker.h 2020-08-18 22:01:01 +05:30
battery
battery_v2 A750FNPUU4CTE3 2020-08-18 17:44:51 +05:30
bcma
block zram: try to avoid worst-case scenario on same element pages 2020-08-19 11:34:40 +05:30
bluetooth
bts
bus
ccic A750FNPUU4CTE3 2020-08-18 17:44:51 +05:30
cdrom
char ipmi:ssif: Handle a possible NULL pointer reference 2020-04-07 14:04:14 +02:00
clk clk: qcom: rcg2: Don't crash if our parent can't be found; return an error 2020-04-07 13:56:02 +02:00
clocksource
connector
cpufreq cpufreq: Overclock the little core to 1.7Ghz 2020-04-08 11:37:14 +02:00
cpuidle
crypto crypto: picoxcell - adjust the position of tasklet_init and fix missed tasklet_kill 2020-04-07 13:50:08 +02:00
dca
devfreq
dio
dma dmaengine: coh901318: Fix a double lock bug in dma_tc_handle() 2020-04-07 14:10:45 +02:00
dma-buf
edac
eisa
extcon
fingerprint A750FNPUU4CTE3 2020-08-18 17:44:51 +05:30
firewire
firmware efi: Add a sanity check to efivar_store_raw() 2020-04-07 14:12:01 +02:00
five
fmc
fpga
gator
gpio
gps
gpu mali: Adapt missing performance-critical IRQ path 2020-08-19 11:33:15 +05:30
gud fix compile errors 2020-04-08 14:18:09 +05:30
hid A750FNPUU4CTE3 2020-08-18 17:44:51 +05:30
hsi
hv
hwmon hwmon: (adt7462) Fix an error return in ADT7462_REG_VOLT() 2020-04-07 14:10:44 +02:00
hwspinlock drivers/hwspinlock: use correct radix tree API 2020-04-07 14:23:53 +02:00
hwtracing intel_th: Fix user-visible error codes 2020-04-07 14:14:24 +02:00
i2c i2c: hix5hd2: add missed clk_disable_unprepare in remove 2020-04-07 14:24:07 +02:00
ide ide: serverworks: potential overflow in svwks_set_pio_mode() 2020-04-07 13:56:59 +02:00
idle
iio iio: buffer: align the size of scan bytes to size of the largest element 2020-04-07 13:45:04 +02:00
infiniband IB/ipoib: Do not warn if IPoIB debugfs doesn't exist 2020-04-07 14:23:46 +02:00
input input: touchscreen: Require low latency 2020-08-18 21:06:05 +05:30
iommu iommu/vt-d: Ignore devices with out-of-spec domain number 2020-04-07 14:11:55 +02:00
ipack
irqchip irqchip/gic-v3-its: Reference to its_invall_cmd descriptor when building INVALL 2020-04-07 13:57:27 +02:00
isdn
leds
lguest
lightnvm
macintosh
mailbox
mcb
md A750FNPUU4CTE3 2020-08-18 17:44:51 +05:30
media A750FNPUU4CTE3 2020-08-18 17:44:51 +05:30
memory
memstick
message
mfd mfd: rn5t618: Mark ADC control register volatile 2020-04-07 13:51:00 +02:00
misc A750FNPUU4CTE3 2020-08-18 17:44:51 +05:30
mmc mmc: Disable CRC check 2020-08-18 21:09:38 +05:30
motor
mtd
muic
net A750FNPUU4CTE3 2020-08-18 17:44:51 +05:30
nfc NFC: fdp: Fix a signedness bug in fdp_nci_send_patch() 2020-04-07 14:23:32 +02:00
ntb
nubus
nvdimm
nvme
nvmem
of of: Add OF_DMA_DEFAULT_COHERENT & select it on powerpc 2020-04-07 13:50:01 +02:00
oprofile
parisc
parport
pci PCI: Don't disable bridge BARs when assigning bus resources 2020-04-07 13:56:46 +02:00
pcmcia
perf
phy
pinctrl pinctrl: sh-pfc: sh7269: Fix CAN function GPIOs 2020-04-07 13:56:29 +02:00
platform MIPS: Loongson: Fix return value of loongson_hwmon_init 2020-04-07 13:43:51 +02:00
pnp
power power: supply: ltc2941-battery-gauge: fix use-after-free 2020-04-07 13:49:57 +02:00
powercap
pps
ps3
ptp
pwm
rapidio
ras
regulator A750FNPUU4CTE3 2020-08-18 17:44:51 +05:30
remoteproc remoteproc: Initialize rproc_class before use 2020-04-07 13:57:01 +02:00
reset
rpmsg
rtc rtc: max8907: add missing select REGMAP_IRQ 2020-04-07 14:14:26 +02:00
s390 s390/cio: cio_ignore_proc_seq_next should increase position index 2020-04-07 14:10:08 +02:00
sbus
scsi scsi: sd: Fix optimal I/O size for devices that change reported values 2020-04-07 14:24:15 +02:00
security/samsung A750FNPUU4CTE3 2020-08-18 17:44:51 +05:30
sensorhub
sensors A750FNPUU4CTE3 2020-08-18 17:44:51 +05:30
sfi
sh
sn
soc exynos-dm: Wrap exynos-ss debugging parts 2020-08-19 11:34:37 +05:30
spi spi/zynqmp: remove entry that causes a cs glitch 2020-04-07 14:13:54 +02:00
spmi
ssb
staging A750FNPUU4CTE3 2020-08-18 17:44:51 +05:30
switch
target scsi: Revert "target: iscsi: Wait for all commands to finish before freeing a session" 2020-04-07 14:03:54 +02:00
tc
tee
thermal
thunderbolt
trace A750FNPUU4CTE3 2020-08-18 17:44:51 +05:30
tty vt: vt_ioctl: fix use-after-free in vt_in_use() 2020-04-07 14:25:18 +02:00
uh
uio uio: fix a sleep-in-atomic-context bug in uio_dmem_genirq_irqcontrol() 2020-04-07 13:55:48 +02:00
usb add toggle for disabling newly added USB devices 2020-08-18 22:05:38 +05:30
uwb
vfio
vhost vhost: Check docket sk_family instead of call getname 2020-04-07 14:23:44 +02:00
video fbdev: Mark decon IRQs and kthreads as perf critical 2020-08-19 11:28:40 +05:30
virt
virtio
vision
vlynq
vme
w1
watchdog watchdog: da9062: do not ping the hw during stop() 2020-04-07 14:10:06 +02:00
xen xen: Enable interrupts when calling _cond_resched() 2020-04-07 14:04:03 +02:00
zorro
Kconfig
Makefile