mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 20:32:04 +09:00
UPSTREAM: 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: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Acked-by: Minchan Kim <minchan@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit e02d238c98)
Signed-off-by: Peter Kalauskas <peskal@google.com>
Bug: 112488418
Change-Id: I911832da703f596998a4139d6033ef1564848c9e
This commit is contained in:
committed by
Peter Kalauskas
parent
dc5f588d8b
commit
6982182465
@@ -19,10 +19,10 @@ static void *zcomp_lz4_create(gfp_t flags)
|
||||
{
|
||||
void *ret;
|
||||
|
||||
ret = kzalloc(LZ4_MEM_COMPRESS, flags);
|
||||
ret = kmalloc(LZ4_MEM_COMPRESS, flags);
|
||||
if (!ret)
|
||||
ret = __vmalloc(LZ4_MEM_COMPRESS,
|
||||
flags | __GFP_ZERO | __GFP_HIGHMEM,
|
||||
flags | __GFP_HIGHMEM,
|
||||
PAGE_KERNEL);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -19,10 +19,10 @@ static void *lzo_create(gfp_t flags)
|
||||
{
|
||||
void *ret;
|
||||
|
||||
ret = kzalloc(LZO1X_MEM_COMPRESS, flags);
|
||||
ret = kmalloc(LZO1X_MEM_COMPRESS, flags);
|
||||
if (!ret)
|
||||
ret = __vmalloc(LZO1X_MEM_COMPRESS,
|
||||
flags | __GFP_ZERO | __GFP_HIGHMEM,
|
||||
flags | __GFP_HIGHMEM,
|
||||
PAGE_KERNEL);
|
||||
return ret;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user