linux/Documentation
zhouxianrong 8e19d540d1 zram: extend zero pages to same element pages
The idea is that without doing more calculations we extend zero pages to
same element pages for zram.  zero page is special case of same element
page with zero element.

1. the test is done under android 7.0
2. startup too many applications circularly
3. sample the zero pages, same pages (none-zero element)
   and total pages in function page_zero_filled

the result is listed as below:

ZERO	SAME	TOTAL
36214	17842	598196

		ZERO/TOTAL	 SAME/TOTAL	  (ZERO+SAME)/TOTAL ZERO/SAME
AVERAGE	0.060631909	 0.024990816  0.085622726		2.663825038
STDEV	0.00674612	 0.005887625  0.009707034		2.115881328
MAX		0.069698422	 0.030046087  0.094975336		7.56043956
MIN		0.03959586	 0.007332205  0.056055193		1.928985507

from the above data, the benefit is about 2.5% and up to 3% of total
swapout pages.

The defect of the patch is that when we recovery a page from non-zero
element the operations are low efficient for partial read.

This patch extends zero_page to same_page so if there is any user to
have monitored zero_pages, he will be surprised if the number is
increased but it's not harmful, I believe.

[minchan@kernel.org: do not free same element pages in zram_meta_free]
  Link: http://lkml.kernel.org/r/20170207065741.GA2567@bbox
Link: http://lkml.kernel.org/r/1483692145-75357-1-git-send-email-zhouxianrong@huawei.com
Link: http://lkml.kernel.org/r/1486307804-27903-1-git-send-email-minchan@kernel.org
Signed-off-by: zhouxianrong <zhouxianrong@huawei.com>
Signed-off-by: Minchan Kim <minchan@kernel.org>
Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-02-24 17:46:56 -08:00
..
ABI First set of updates for 4.11 kernel merge window 2017-02-23 08:27:57 -08:00
DocBook A slightly quieter cycle for documentation this time around. 2017-02-22 18:51:29 -08:00
EDID
PCI
RCU
accounting
acpi
admin-guide Merge branch 'akpm' (patches from Andrew) 2017-02-22 19:29:24 -08:00
aoe
arm
arm64
auxdisplay
backlight
blackfin
block A slightly quieter cycle for documentation this time around. 2017-02-22 18:51:29 -08:00
blockdev zram: extend zero pages to same element pages 2017-02-24 17:46:56 -08:00
bus-devices
cdrom
cgroup-v1
cma
connector
console
core-api
cpu-freq A slightly quieter cycle for documentation this time around. 2017-02-22 18:51:29 -08:00
cpuidle
cris
crypto
dev-tools
device-mapper
devicetree Less anger inducing pull request for 4.11 2017-02-23 18:58:18 -08:00
dmaengine
doc-guide
driver-api Less anger inducing pull request for 4.11 2017-02-23 18:58:18 -08:00
driver-model
early-userspace
extcon
fault-injection
fb
features
filesystems
firmware_class
fmc
fpga
frv
gpio
gpu Less anger inducing pull request for 4.11 2017-02-23 18:58:18 -08:00
hid
hwmon A slightly quieter cycle for documentation this time around. 2017-02-22 18:51:29 -08:00
i2c
ia64
ide
iio
infiniband
input
ioctl rpmsg updates for v4.11 2017-02-23 09:41:03 -08:00
isdn
kbuild
kdump
laptops
leds
livepatch A slightly quieter cycle for documentation this time around. 2017-02-22 18:51:29 -08:00
locking
m68k
media A slightly quieter cycle for documentation this time around. 2017-02-22 18:51:29 -08:00
memory-devices
metag
mic
mips
misc-devices
mmc
mn10300
mtd
namespaces
netlabel
networking A slightly quieter cycle for documentation this time around. 2017-02-22 18:51:29 -08:00
nfc
nios2
nvdimm
nvmem
parisc
pcmcia
perf
phy
platform
power A slightly quieter cycle for documentation this time around. 2017-02-22 18:51:29 -08:00
powerpc
pps
prctl
process
pti
ptp
rapidio
s390
scheduler
scsi
security This renames the (now inaccurate) CONFIG_DEBUG_RODATA and related config 2017-02-21 17:56:45 -08:00
serial
sh
sound
sphinx
sphinx-static
spi
sysctl mm, madvise: fail with ENOMEM when splitting vma will hit max_map_count 2017-02-24 17:46:55 -08:00
target
thermal
timers
trace trace-vmscan-postprocess: sync with tracepoints updates 2017-02-22 16:41:29 -08:00
translations
usb A slightly quieter cycle for documentation this time around. 2017-02-22 18:51:29 -08:00
virtual
vm mm, madvise: fail with ENOMEM when splitting vma will hit max_map_count 2017-02-24 17:46:55 -08:00
w1
watchdog
wimax
x86
xtensa
.gitignore
00-INDEX
Changes
CodingStyle
DMA-API-HOWTO.txt
DMA-API.txt
DMA-ISA-LPC.txt
DMA-attributes.txt
IPMI.txt
IRQ-affinity.txt
IRQ-domain.txt
IRQ.txt
Intel-IOMMU.txt
Makefile
Makefile.sphinx
SAK.txt
SM501.txt
SubmittingPatches
bcache.txt
bt8xxgpio.txt
btmrvl.txt
bus-virt-phys-mapping.txt
cachetlb.txt
cgroup-v2.txt
circular-buffers.txt
clk.txt
conf.py
cpu-load.txt
cputopology.txt
crc32.txt
dcdbas.txt
debugging-modules.txt
debugging-via-ohci1394.txt
dell_rbu.txt
digsig.txt
docutils.conf
dontdiff
efi-stub.txt
eisa.txt
flexible-arrays.txt
futex-requeue-pi.txt
gcc-plugins.txt
highuid.txt
hw_random.txt
hwspinlock.txt
index.rst
intel_txt.txt
io-mapping.txt
io_ordering.txt
iostats.txt
irqflags-tracing.txt
isa.txt
isapnp.txt
kernel-doc-nano-HOWTO.txt
kernel-per-CPU-kthreads.txt
kobject.txt
kprobes.txt
kref.txt
kselftest.txt
ldm.txt
lockup-watchdogs.txt
logo.gif
logo.txt
lzo.txt
mailbox.txt
md-cluster.txt
memory-barriers.txt
memory-hotplug.txt
men-chameleon-bus.txt
nommu-mmap.txt
ntb.txt
numastat.txt
padata.txt
parport-lowlevel.txt
percpu-rw-semaphore.txt
phy.txt
pi-futex.txt
pinctrl.txt
pnp.txt
preempt-locking.txt
printk-formats.txt
pwm.txt
rbtree.txt
remoteproc.txt
rfkill.txt
robust-futex-ABI.txt
robust-futexes.txt
rpmsg.txt
rtc.txt
sgi-ioc4.txt
siphash.txt
smsc_ece1099.txt
static-keys.txt
svga.txt
sync_file.txt
this_cpu_ops.txt
unaligned-memory-access.txt
unshare.txt
vfio-mediated-device.txt
vfio.txt
video-output.txt
xillybus.txt
xz.txt
zorro.txt