|author||Minchan Kim <firstname.lastname@example.org>||2015-04-15 16:15:46 -0700|
|committer||Linus Torvalds <email@example.com>||2015-04-15 16:35:21 -0700|
zsmalloc: zsmalloc documentation
Create zsmalloc doc which explains design concept and stat information. Signed-off-by: Minchan Kim <firstname.lastname@example.org> Cc: Juneho Choi <email@example.com> Cc: Gunho Lee <firstname.lastname@example.org> Cc: Luigi Semenzato <email@example.com> Cc: Dan Streetman <firstname.lastname@example.org> Cc: Seth Jennings <email@example.com> Cc: Nitin Gupta <firstname.lastname@example.org> Cc: Jerome Marchand <email@example.com> Cc: Sergey Senozhatsky <firstname.lastname@example.org> Cc: Joonsoo Kim <email@example.com> Signed-off-by: Andrew Morton <firstname.lastname@example.org> Signed-off-by: Linus Torvalds <email@example.com>
Diffstat (limited to 'mm')
1 files changed, 0 insertions, 29 deletions
diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index 461243e14d3e..1833fc9e09cb 100644
@@ -12,35 +12,6 @@
- * This allocator is designed for use with zram. Thus, the allocator is
- * supposed to work well under low memory conditions. In particular, it
- * never attempts higher order page allocation which is very likely to
- * fail under memory pressure. On the other hand, if we just use single
- * (0-order) pages, it would suffer from very high fragmentation --
- * any object of size PAGE_SIZE/2 or larger would occupy an entire page.
- * This was one of the major issues with its predecessor (xvmalloc).
- * To overcome these issues, zsmalloc allocates a bunch of 0-order pages
- * and links them together using various 'struct page' fields. These linked
- * pages act as a single higher-order page i.e. an object can span 0-order
- * page boundaries. The code refers to these linked pages as a single entity
- * called zspage.
- * For simplicity, zsmalloc can only allocate objects of size up to PAGE_SIZE
- * since this satisfies the requirements of all its current users (in the
- * worst case, page is incompressible and is thus stored "as-is" i.e. in
- * uncompressed form). For allocation requests larger than this size, failure
- * is returned (see zs_malloc).
- * Additionally, zs_malloc() does not return a dereferenceable pointer.
- * Instead, it returns an opaque handle (unsigned long) which encodes actual
- * location of the allocated object. The reason for this indirection is that
- * zsmalloc does not keep zspages permanently mapped since that would cause
- * issues on 32-bit systems where the VA region for kernel space mappings
- * is very small. So, before using the allocating memory, the object has to
- * be mapped using zs_map_object() to get a usable pointer and subsequently
- * unmapped using zs_unmap_object().
* Following is how we use various fields and flags of underlying
* struct page(s) to form a zspage.