mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-07 20:33:58 -04:00
mm/zsmalloc.c: convert to use kmem_cache_zalloc in cache_alloc_zspage()
[ Upstream commit f0231305acd53375c6cf736971bf5711105dd6bb ] We always memset the zspage allocated via cache_alloc_zspage. So it's more convenient to use kmem_cache_zalloc in cache_alloc_zspage than caller do it manually. Link: https://lkml.kernel.org/r/20210114120032.25885-1-linmiaohe@huawei.com Signed-off-by: Miaohe Lin <linmiaohe@huawei.com> Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Cc: Minchan Kim <minchan@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Stable-dep-of: 694d6b99923e ("mm/zsmalloc: do not pass __GFP_MOVABLE if CONFIG_COMPACTION=n") Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
0e0d8c68f3
commit
a773caa6b4
1 changed files with 1 additions and 2 deletions
|
|
@ -357,7 +357,7 @@ static void cache_free_handle(struct zs_pool *pool, unsigned long handle)
|
|||
|
||||
static struct zspage *cache_alloc_zspage(struct zs_pool *pool, gfp_t flags)
|
||||
{
|
||||
return kmem_cache_alloc(pool->zspage_cachep,
|
||||
return kmem_cache_zalloc(pool->zspage_cachep,
|
||||
flags & ~(__GFP_HIGHMEM|__GFP_MOVABLE));
|
||||
}
|
||||
|
||||
|
|
@ -1067,7 +1067,6 @@ static struct zspage *alloc_zspage(struct zs_pool *pool,
|
|||
if (!zspage)
|
||||
return NULL;
|
||||
|
||||
memset(zspage, 0, sizeof(struct zspage));
|
||||
zspage->magic = ZSPAGE_MAGIC;
|
||||
migrate_lock_init(zspage);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue