linux/drivers/staging
Minchan Kim bcf1647d08 zsmalloc: move it under mm
This patch moves zsmalloc under mm directory.

Before that, description will explain why we have needed custom
allocator.

Zsmalloc is a new slab-based memory allocator for storing compressed
pages.  It is designed for low fragmentation and high allocation success
rate on large object, but <= PAGE_SIZE allocations.

zsmalloc differs from the kernel slab allocator in two primary ways to
achieve these design goals.

zsmalloc never requires high order page allocations to back slabs, or
"size classes" in zsmalloc terms.  Instead it allows multiple
single-order pages to be stitched together into a "zspage" which backs
the slab.  This allows for higher allocation success rate under memory
pressure.

Also, zsmalloc allows objects to span page boundaries within the zspage.
This allows for lower fragmentation than could be had with the kernel
slab allocator for objects between PAGE_SIZE/2 and PAGE_SIZE.  With the
kernel slab allocator, if a page compresses to 60% of it original size,
the memory savings gained through compression is lost in fragmentation
because another object of the same size can't be stored in the leftover
space.

This ability to span pages results in zsmalloc allocations not being
directly addressable by the user.  The user is given an
non-dereferencable handle in response to an allocation request.  That
handle must be mapped, using zs_map_object(), which returns a pointer to
the mapped region that can be used.  The mapping is necessary since the
object data may reside in two different noncontigious pages.

The zsmalloc fulfills the allocation needs for zram perfectly

[sjenning@linux.vnet.ibm.com: borrow Seth's quote]
Signed-off-by: Minchan Kim <minchan@kernel.org>
Acked-by: Nitin Gupta <ngupta@vflare.org>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Bob Liu <bob.liu@oracle.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Hugh Dickins <hughd@google.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Luigi Semenzato <semenzato@google.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: Rik van Riel <riel@redhat.com>
Cc: Seth Jennings <sjenning@linux.vnet.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2014-01-30 16:56:55 -08:00
..
android ion: Add carveout and chunk heaps to dummy driver 2014-01-09 21:16:40 -08:00
bcm Staging driver tree patches for 3.14-rc1 2014-01-20 15:51:35 -08:00
ced1401 staging: delete non-required instances of include <linux/init.h> 2013-12-17 10:08:14 -08:00
comedi Staging: comedi: fix extra whitespace style issues in ni_mio_common.c. 2014-01-13 15:04:52 -08:00
cptm1217
crystalhd staging: delete non-required instances of include <linux/init.h> 2013-12-17 10:08:14 -08:00
cxt1e1 Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2014-01-25 11:17:34 -08:00
dgap Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2014-01-25 11:17:34 -08:00
dgnc drivers: dgnc: Include appropriate header file in dgnc_trace.c 2014-01-08 15:47:35 -08:00
dgrp staging: delete non-required instances of include <linux/init.h> 2013-12-17 10:08:14 -08:00
echo
et131x staging: delete non-required instances of include <linux/init.h> 2013-12-17 10:08:14 -08:00
frontier staging: delete non-required instances of include <linux/init.h> 2013-12-17 10:08:14 -08:00
ft1000 staging: delete non-required instances of include <linux/init.h> 2013-12-17 10:08:14 -08:00
fwserial staging/fwserial: Add Kconfig options for max ports 2013-12-08 17:03:03 -08:00
gdm72xx staging: gdm72xx: fix interruptible_sleep_on race 2014-01-09 10:41:44 -08:00
gdm724x staging: delete non-required instances of include <linux/init.h> 2013-12-17 10:08:14 -08:00
goldfish staging: delete non-required instances of include <linux/init.h> 2013-12-17 10:08:14 -08:00
iio Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2014-01-25 11:17:34 -08:00
imx-drm imx-drm: parallel-display: honor 'native-mode' property when selecting video mode from DT 2014-01-13 15:14:43 -08:00
keucr staging: keucr: Fix typo in keucr driver 2013-12-17 13:10:40 -08:00
line6 staging: line6: Add support for POD HD400 to line6usb driver 2013-12-21 16:03:34 -08:00
lustre Merge branch 'for-3.14/core' of git://git.kernel.dk/linux-block 2014-01-30 11:19:05 -08:00
media staging: delete non-required instances of include <linux/init.h> 2013-12-17 10:08:14 -08:00
mt29f_spinand
netlogic net: core: explicitly select a txq before doing l2 forwarding 2014-01-10 13:23:08 -05:00
nvec ARM: SoC cleanups for 3.14 2014-01-23 18:36:55 -08:00
octeon staging: delete non-required instances of include <linux/init.h> 2013-12-17 10:08:14 -08:00
octeon-usb usb: hcd: move controller wakeup setting initialization to individual driver 2013-12-08 18:06:46 -08:00
olpc_dcon
ozwpan Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2014-01-25 11:17:34 -08:00
panel staging: panel: fix interruptible_sleep_on race 2014-01-09 10:41:44 -08:00
phison staging: delete non-required instances of include <linux/init.h> 2013-12-17 10:08:14 -08:00
quickstart ACPI: Clean up inclusions of ACPI header files 2013-12-07 01:03:14 +01:00
rtl8187se Staging: rtl8187se: ieee80211: ieee80211_softmac.c: mark symbols as static 2014-01-11 12:37:58 -08:00
rtl8188eu Staging driver tree patches for 3.14-rc1 2014-01-20 15:51:35 -08:00
rtl8192e Staging rtl8192e: Correcting wrong usage of macro in r8192E_phy.c and removing corresponding warning in rtllib_debug.h 2014-01-09 10:32:18 -08:00
rtl8192u staging: delete non-required instances of include <linux/init.h> 2013-12-17 10:08:14 -08:00
rtl8712 staging: r8712u: Set device type to wlan 2014-01-09 10:35:25 -08:00
rts5139 Staging: rts5139: rts51x_card: fixed style issues 2014-01-13 15:24:18 -08:00
rts5208 staging: delete non-required instances of include <linux/init.h> 2013-12-17 10:08:14 -08:00
sb105x staging: delete non-required instances of include <linux/init.h> 2013-12-17 10:08:14 -08:00
sbe-2t3e3 drivers: sbe-2t3e3: Mark functions as static in ctrl.c 2014-01-08 15:45:24 -08:00
sep staging: sep: add missing destroy_workqueue() in sep_crypto.c 2013-12-20 11:45:09 -08:00
serqt_usb2 staging: serqt_usb2: don't use sleep_on 2014-01-09 10:41:44 -08:00
silicom Staging: silicom: fix sparse non static symbol warnings 2014-01-09 10:28:15 -08:00
slicoss staging: slicoss: Remove last reference to compare_ether_addr 2013-12-06 12:57:15 -08:00
sm7xxfb drivers: sm7xxfb: Mark function as static in sm7xxfb.c 2014-01-08 15:45:24 -08:00
speakup
ste_rmi4
tidspbridge staging: tidspbridge: adjust error return code (bugfix) 2014-01-13 15:24:18 -08:00
usbip Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial 2014-01-22 21:21:55 -08:00
vme vme_user: Use __u64 and __u32 in userspace structs 2013-12-18 16:20:13 -08:00
vt6655 staging: vt6655: Fix memory leak in wpa_ioctl() 2014-01-13 15:19:41 -08:00
vt6656 staging: vt6656: sparse fixes: iwctl_giwgenie use memcpy. 2014-01-13 15:46:19 -08:00
winbond Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next 2014-01-25 11:17:34 -08:00
wlags49_h2 staging: wlags49_h2: Fix "do not use C99 //" in wl_cs.h, wl_enc.h wl_main.h and wl_wext.h 2014-01-13 15:19:41 -08:00
wlags49_h25
wlan-ng staging: wlan-ng: fix leaks on failure paths in prism2sta_probe_usb() 2014-01-11 12:52:42 -08:00
xgifb staging: remove DEFINE_PCI_DEVICE_TABLE macro 2013-12-02 22:32:35 -08:00
xillybus staging: xillybus: Open Firmware driver supporting coherent DMA 2014-01-09 10:42:36 -08:00
zram zsmalloc: move it under mm 2014-01-30 16:56:55 -08:00
Kconfig zsmalloc: move it under mm 2014-01-30 16:56:55 -08:00
Makefile zsmalloc: move it under mm 2014-01-30 16:56:55 -08:00
staging.c