aboutsummaryrefslogtreecommitdiff
path: root/include/linux/zbud.h
AgeCommit message (Collapse)AuthorFilesLines
2014-08-06mm/zbud: change zbud_alloc size type to size_tDan Streetman1-1/+1
Change the type of the zbud_alloc() size param from unsigned int to size_t. Technically, this should not make any difference, as the zbud implementation already restricts the size to well within either type's limits; but as zsmalloc (and kmalloc) use size_t, and zpool will use size_t, this brings the size parameter type in line with zsmalloc/zpool. Signed-off-by: Dan Streetman <[email protected]> Acked-by: Seth Jennings <[email protected]> Tested-by: Seth Jennings <[email protected]> Cc: Weijie Yang <[email protected]> Cc: Minchan Kim <[email protected]> Cc: Nitin Gupta <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2014-06-04mm/zbud.c: make size unsigned like unique callsiteFabian Frederick1-1/+1
zbud_alloc is only called by zswap_frontswap_store with unsigned int len. Change function parameter + update >= 0 check. Signed-off-by: Fabian Frederick <[email protected]> Acked-by: Seth Jennings <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
2013-07-10zbud: add to mm/Seth Jennings1-0/+22
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. Signed-off-by: Seth Jennings <[email protected]> Acked-by: Rik van Riel <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Nitin Gupta <[email protected]> Cc: Minchan Kim <[email protected]> Cc: Konrad Rzeszutek Wilk <[email protected]> Cc: Dan Magenheimer <[email protected]> Cc: Robert Jennings <[email protected]> Cc: Jenifer Hopper <[email protected]> Cc: Mel Gorman <[email protected]> Cc: Johannes Weiner <[email protected]> Cc: Larry Woodman <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Dave Hansen <[email protected]> Cc: Joe Perches <[email protected]> Cc: Joonsoo Kim <[email protected]> Cc: Cody P Schafer <[email protected]> Cc: Hugh Dickens <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Bob Liu <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>