Skip to content

Commit 61989a8

Browse files
Nitin Guptagregkh
authored andcommitted
staging: zsmalloc: zsmalloc memory allocation library
This patch creates a new memory allocation library named zsmalloc. NOTE: zsmalloc currently depends on SPARSEMEM for the MAX_PHYSMEM_BITS value needed to determine the format of the object handle. There may be a better way to do this. Feedback is welcome. Signed-off-by: Nitin Gupta <ngupta@vflare.org> Signed-off-by: Seth Jennings <sjenning@linux.vnet.ibm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 17dd9f8 commit 61989a8

File tree

5 files changed

+927
-0
lines changed

5 files changed

+927
-0
lines changed

drivers/staging/zsmalloc/Kconfig

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
config ZSMALLOC
2+
tristate "Memory allocator for compressed pages"
3+
depends on SPARSEMEM
4+
default n
5+
help
6+
zsmalloc is a slab-based memory allocator designed to store
7+
compressed RAM pages. zsmalloc uses virtual memory mapping
8+
in order to reduce fragmentation. However, this results in a
9+
non-standard allocator interface where a handle, not a pointer, is
10+
returned by an alloc(). This handle must be mapped in order to
11+
access the allocated space.

drivers/staging/zsmalloc/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
zsmalloc-y := zsmalloc-main.o
2+
3+
obj-$(CONFIG_ZSMALLOC) += zsmalloc.o

0 commit comments

Comments
 (0)