+ zbud-add-to-mm.patch added to -mm tree
Subsystems (2)
[email protected]
maintainerSubject: + zbud-add-to-mm.patch added to -mm tree
To: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected]
From: [email protected]
Date: Wed, 12 Jun 2013 14:39:02 -0700
The patch titled
Subject: zbud: add to mm/
has been added to the -mm tree. Its filename is
zbud-add-to-mm.patch
Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's
*** Remember to use Documentation/SubmitChecklist when testing your code ***
The -mm tree is included into linux-next and is updated there every 3-4 working days
------------------------------------------------------
From: Seth Jennings <[email protected]>
Subject: zbud: add to mm/
zbud is an special purpose allocator for storing compressed pages. It is designed to store up to two compressed pages per physical page. While this design limits storage density, it has simple and deterministic reclaim properties that make it preferable to a higher density approach when reclaim will be used.
zbud works by storing compressed pages, or "zpages", together in pairs in a single memory page called a "zbud page". The first buddy is "left justifed" at the beginning of the zbud page, and the last buddy is "right justified" at the end of the zbud page. The benefit is that if either buddy is freed, the freed buddy space, coalesced with whatever slack space that existed between the buddies, results in the largest possible free region within the zbud page.
zbud also provides an attractive lower bound on density. The ratio of zpages to zbud pages can not be less than 1. This ensures that zbud can never "do harm" by using more pages to store zpages than the uncompressed zpages would have used on their own.
This implementation is a rewrite of the zbud allocator internally used by zcache in the driver/staging tree. The rewrite was necessary to remove some of the zcache specific elements that were ingrained throughout and provide a generic allocation interface that can later be used by zsmalloc and others.
This patch adds zbud to mm/ for later use by zswap.
---
include/linux/zbud.h | 22 + mm/Kconfig | 10 mm/Makefile | 1 mm/zbud.c | 526 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 559 insertions(+)
include/linux/zbud.h new file +22 -0
@@ -0,0 +1,22 @@ +#ifndef _ZBUD_H_ +#define _ZBUD_H_ + +#include <linux/types.h> + +struct zbud_pool ; + +struct zbud_ops { +int (*evict)(struct zbud_pool *pool,unsigned long handle); +}; + +struct zbud_pool *zbud_create_pool (gfp_t gfp,struct zbud_ops *ops); +void zbud_destroy_pool (struct zbud_pool *pool); +int zbud_alloc (struct zbud_pool *pool,int size,gfp_t gfp, +unsigned long *handle); +void zbud_free (struct zbud_pool *pool,unsigned long handle); +int zbud_reclaim_page (struct zbud_pool *pool,unsigned int retries); +void *zbud_map (struct zbud_pool *pool,unsigned long handle); +void zbud_unmap (struct zbud_pool *pool,unsigned long handle); +u64 zbud_get_pool_size (struct zbud_pool *pool); + +#endif /* _ZBUD_H_ */
mm/Kconfig renamed from mm/Kconfig~zbud-add-to-mm +10 -0
@@ -478,6 +478,16 @@ config FRONTSWAP If unsure, say Y to enable frontswap. +config ZBUD + tristate + default n + help + A special purpose allocator for storing compressed pages. + It is designed to store up to two compressed pages per physical + page. While this design limits storage density, it has simple and + deterministic reclaim properties that make it preferable to a higher + density approach when reclaim will be used. + config MEM_SOFT_DIRTY bool "Track memory changes" depends on CHECKPOINT_RESTORE && HAVE_ARCH_SOFT_DIRTY
mm/Makefile renamed from mm/Makefile~zbud-add-to-mm +1 -0
@@ -58,3 +58,4 @@ obj-$(CONFIG_DEBUG_KMEMLEAK) += kmemleak obj-$(CONFIG_DEBUG_KMEMLEAK_TEST) += kmemleak-test.o obj-$(CONFIG_CLEANCACHE) += cleancache.o obj-$(CONFIG_MEMORY_ISOLATION) += page_isolation.o +obj-$(CONFIG_ZBUD) += zbud.o
mm/zbud.c new file +526 -0
526 lines not on this page · raw message
_
Patches currently in -mm which might be from [email protected] are
linux-next.patch mm-remove-compressed-copy-from-zram-in-memory.patch mm-remove-compressed-copy-from-zram-in-memory-fix.patch mm-remove-compressed-copy-from-zram-in-memory-fix-2.patch mm-remove-compressed-copy-from-zram-in-memory-fix-2-fix.patch zbud-add-to-mm.patch
zswap-add-to-mm.patch
zswap-add-documentation.patch