[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20130215131724.GP12339@twin.jikos.cz>
Date: Fri, 15 Feb 2013 14:17:24 +0100
From: David Sterba <dsterba@...e.cz>
To: Kyungsik Lee <kyungsik.lee@....com>
Cc: Chris Mason <chris.mason@...ionio.com>,
linux-btrfs@...r.kernel.org, linux-kernel@...r.kernel.org,
David Sterba <dsterba@...e.cz>, hyojun.im@....com,
chan.jeong@....com, raphael.andy.lee@...il.com
Subject: Re: [PATCH] btrfs: use kmalloc for lzo de/compress buffer
On Fri, Feb 15, 2013 at 10:08:21PM +0900, Kyungsik Lee wrote:
> The size of de/compress buffer and LZO1X_MEM_COMPRESS is small enough.
Unfortunatelly it is not.
include/linux/lzo.h:
#define LZO1X_MEM_COMPRESS (16384 * sizeof(unsigned char *))
128k with 8 byte pointers
> @@ -54,9 +53,10 @@ static struct list_head *lzo_alloc_workspace(void)
> if (!workspace)
> return ERR_PTR(-ENOMEM);
>
> - workspace->mem = vmalloc(LZO1X_MEM_COMPRESS);
vmalloc needed
> - workspace->buf = vmalloc(PAGE_CACHE_SIZE);
kmalloc is ok here
> - workspace->cbuf = vmalloc(lzo1x_worst_compress(PAGE_CACHE_SIZE));
#define lzo1x_worst_compress(x) ((x) + ((x) / 16) + 64 + 3)
4096+4096/16+64+3 = 4419
vmalloc needed as well
david
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists