Commit e02d238c authored by Sergey Senozhatsky's avatar Sergey Senozhatsky Committed by Linus Torvalds

zram/zcomp: do not zero out zcomp private pages

Do not __GFP_ZERO allocated zcomp ->private pages.  We keep allocated
streams around and use them for read/write requests, so we supply a
zeroed out ->private to compression algorithm as a scratch buffer only
once -- the first time we use that stream.  For the rest of IO requests
served by this stream ->private usually contains some temporarily data
from the previous requests.
Signed-off-by: default avatarSergey Senozhatsky <sergey.senozhatsky@gmail.com>
Acked-by: default avatarMinchan Kim <minchan@kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 75d8947a
...@@ -19,10 +19,10 @@ static void *zcomp_lz4_create(gfp_t flags) ...@@ -19,10 +19,10 @@ static void *zcomp_lz4_create(gfp_t flags)
{ {
void *ret; void *ret;
ret = kzalloc(LZ4_MEM_COMPRESS, flags); ret = kmalloc(LZ4_MEM_COMPRESS, flags);
if (!ret) if (!ret)
ret = __vmalloc(LZ4_MEM_COMPRESS, ret = __vmalloc(LZ4_MEM_COMPRESS,
flags | __GFP_ZERO | __GFP_HIGHMEM, flags | __GFP_HIGHMEM,
PAGE_KERNEL); PAGE_KERNEL);
return ret; return ret;
} }
......
...@@ -19,10 +19,10 @@ static void *lzo_create(gfp_t flags) ...@@ -19,10 +19,10 @@ static void *lzo_create(gfp_t flags)
{ {
void *ret; void *ret;
ret = kzalloc(LZO1X_MEM_COMPRESS, flags); ret = kmalloc(LZO1X_MEM_COMPRESS, flags);
if (!ret) if (!ret)
ret = __vmalloc(LZO1X_MEM_COMPRESS, ret = __vmalloc(LZO1X_MEM_COMPRESS,
flags | __GFP_ZERO | __GFP_HIGHMEM, flags | __GFP_HIGHMEM,
PAGE_KERNEL); PAGE_KERNEL);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment