From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755083Ab2LKV6A (ORCPT ); Tue, 11 Dec 2012 16:58:00 -0500 Received: from e7.ny.us.ibm.com ([32.97.182.137]:45203 "EHLO e7.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754851Ab2LKV4b (ORCPT ); Tue, 11 Dec 2012 16:56:31 -0500 From: Seth Jennings To: Greg Kroah-Hartman , Andrew Morton Cc: Seth Jennings , Nitin Gupta , Minchan Kim , Konrad Rzeszutek Wilk , Dan Magenheimer , Robert Jennings , Jenifer Hopper , Mel Gorman , Johannes Weiner , Rik van Riel , Larry Woodman , linux-mm@kvack.org, linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org Subject: [PATCH 4/8] staging: zsmalloc: make CLASS_DELTA relative to PAGE_SIZE Date: Tue, 11 Dec 2012 15:56:02 -0600 Message-Id: <1355262966-15281-5-git-send-email-sjenning@linux.vnet.ibm.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1355262966-15281-1-git-send-email-sjenning@linux.vnet.ibm.com> References: <1355262966-15281-1-git-send-email-sjenning@linux.vnet.ibm.com> X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12121121-5806-0000-0000-00001CDC5AFC Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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 825e124..3543047 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) -- 1.7.9.5