Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752934Ab0HIR1d (ORCPT ); Mon, 9 Aug 2010 13:27:33 -0400 Received: from mail-fx0-f46.google.com ([209.85.161.46]:60296 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753381Ab0HIR1Z (ORCPT ); Mon, 9 Aug 2010 13:27:25 -0400 From: Nitin Gupta To: Pekka Enberg , Minchan Kim , Andrew Morton , Greg KH Cc: Linux Driver Project , linux-mm , linux-kernel Subject: [PATCH 07/10] Increase compressed page size threshold Date: Mon, 9 Aug 2010 22:56:53 +0530 Message-Id: <1281374816-904-8-git-send-email-ngupta@vflare.org> X-Mailer: git-send-email 1.7.2.1 In-Reply-To: <1281374816-904-1-git-send-email-ngupta@vflare.org> References: <1281374816-904-1-git-send-email-ngupta@vflare.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1531 Lines: 37 Compression takes much more time than decompression. So, its quite wasteful in terms of both CPU cycles and memory usage to have a very low compressed page size threshold and thereby storing such not-so-well compressible pages as-is (uncompressed). So, increasing it from PAGE_SIZE/2 to PAGE_SIZE/8*7. A low threshold was useful when we had "backing swap" support where we could forward such pages to the backing device (applicable only when zram was used as swap disk). It is not yet configurable through sysfs but may be exported in future, along with threshold for average compression ratio. Signed-off-by: Nitin Gupta --- drivers/staging/zram/zram_drv.h | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/staging/zram/zram_drv.h b/drivers/staging/zram/zram_drv.h index 65e512d..bcc51ea 100644 --- a/drivers/staging/zram/zram_drv.h +++ b/drivers/staging/zram/zram_drv.h @@ -47,7 +47,7 @@ static const unsigned default_disksize_perc_ram = 25; * Pages that compress to size greater than this are stored * uncompressed in memory. */ -static const unsigned max_zpage_size = PAGE_SIZE / 4 * 3; +static const unsigned max_zpage_size = PAGE_SIZE / 8 * 7; /* * NOTE: max_zpage_size must be less than or equal to: -- 1.7.2.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/