Re: [PATCH 4/4] staging: zsmalloc: make CLASS_DELTA relative to PAGE_SIZE
On Fri, Jan 25, 2013 at 11:46:18AM -0600, Seth Jennings wrote: > 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 > Signed-off-by: Seth Jennings Acked-by: Minchan Kim -- Kind regards, Minchan Kim -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH 4/4] staging: zsmalloc: make CLASS_DELTA relative to PAGE_SIZE
On Fri, Jan 25, 2013 at 11:46:18AM -0600, Seth Jennings wrote: 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 ngu...@vflare.org Signed-off-by: Seth Jennings sjenn...@linux.vnet.ibm.com Acked-by: Minchan Kim minc...@kernel.org -- Kind regards, Minchan Kim -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 4/4] 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 Signed-off-by: Seth Jennings --- drivers/staging/zsmalloc/zsmalloc-main.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/zsmalloc/zsmalloc-main.c b/drivers/staging/zsmalloc/zsmalloc-main.c index 12f66c3..13018b7 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_DELTA16 +#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) -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH 4/4] 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 ngu...@vflare.org Signed-off-by: Seth Jennings sjenn...@linux.vnet.ibm.com --- drivers/staging/zsmalloc/zsmalloc-main.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/zsmalloc/zsmalloc-main.c b/drivers/staging/zsmalloc/zsmalloc-main.c index 12f66c3..13018b7 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_DELTA16 +#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) -- 1.7.9.5 -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/