diff options
author | Seth Jennings <sjenning@linux.vnet.ibm.com> | 2013-01-25 11:46:18 -0600 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-01-29 23:16:42 -0500 |
commit | d662b8eba94e9f6d4c036719dbf629ef0c9309cf (patch) | |
tree | c57b4750cf0c14723ca1a5c7f6850e1ae155c760 /drivers/staging/zsmalloc | |
parent | e21545449b2b96775065f237063a224fff21ed9d (diff) | |
download | talos-obmc-linux-d662b8eba94e9f6d4c036719dbf629ef0c9309cf.tar.gz talos-obmc-linux-d662b8eba94e9f6d4c036719dbf629ef0c9309cf.zip |
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: Nitin Gupta <ngupta@vflare.org>
Acked-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Seth Jennings <sjenning@linux.vnet.ibm.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/zsmalloc')
-rw-r--r-- | drivers/staging/zsmalloc/zsmalloc-main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/zsmalloc/zsmalloc-main.c b/drivers/staging/zsmalloc/zsmalloc-main.c index eb0077261ac6..93eb03e30fb4 100644 --- a/drivers/staging/zsmalloc/zsmalloc-main.c +++ b/drivers/staging/zsmalloc/zsmalloc-main.c @@ -141,7 +141,7 @@ * ZS_MIN_ALLOC_SIZE and ZS_SIZE_CLASS_DELTA must be multiple of ZS_ALIGN * (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) / \ ZS_SIZE_CLASS_DELTA + 1) |