Commit d662b8eb authored by Seth Jennings's avatar Seth Jennings Committed by Greg Kroah-Hartman

staging: zsmalloc: make CLASS_DELTA relative to PAGE_SIZE

Right now ZS_SIZE_CLASS_DELTA is hardcoded to be 16.  This
creates 254 classes for systems with 4k pages. However, on
PPC64 with 64k pages, it creates 4095 classes which is far
too many.

This patch makes ZS_SIZE_CLASS_DELTA relative to PAGE_SIZE
so that regardless of the page size, there will be the same
number of classes.
Acked-by: default avatarNitin Gupta <ngupta@vflare.org>
Acked-by: default avatarMinchan Kim <minchan@kernel.org>
Signed-off-by: default avatarSeth Jennings <sjenning@linux.vnet.ibm.com>
Acked-by: default avatarDan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e2154544
...@@ -141,7 +141,7 @@ ...@@ -141,7 +141,7 @@
* ZS_MIN_ALLOC_SIZE and ZS_SIZE_CLASS_DELTA must be multiple of ZS_ALIGN * ZS_MIN_ALLOC_SIZE and ZS_SIZE_CLASS_DELTA must be multiple of ZS_ALIGN
* (reason above) * (reason above)
*/ */
#define ZS_SIZE_CLASS_DELTA 16 #define ZS_SIZE_CLASS_DELTA (PAGE_SIZE >> 8)
#define ZS_SIZE_CLASSES ((ZS_MAX_ALLOC_SIZE - ZS_MIN_ALLOC_SIZE) / \ #define ZS_SIZE_CLASSES ((ZS_MAX_ALLOC_SIZE - ZS_MIN_ALLOC_SIZE) / \
ZS_SIZE_CLASS_DELTA + 1) ZS_SIZE_CLASS_DELTA + 1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment