zsmalloc: require GFP in zs_malloc()
authorSergey Senozhatsky <sergey.senozhatsky@gmail.com>
Fri, 20 May 2016 23:59:48 +0000 (16:59 -0700)
committerDanny Wood <danwood76@gmail.com>
Tue, 14 Sep 2021 19:03:01 +0000 (20:03 +0100)
commitb558424f56e0b22dfb4c730a754ecec13078fb51
tree90c5548ff266cb7f1dd132bd797f30a543e5e354
parent31c4cf411958614d229ac3d178aa63e4a8ed94e4
zsmalloc: require GFP in zs_malloc()

Pass GFP flags to zs_malloc() instead of using a fixed mask supplied to
zs_create_pool(), so we can be more flexible, but, more importantly, we
need this to switch zram to per-cpu compression streams -- zram will try
to allocate handle with preemption disabled in a fast path and switch to
a slow path (using different gfp mask) if the fast one has failed.

Apart from that, this also align zs_malloc() interface with zspool/zbud.

[sergey.senozhatsky@gmail.com: pass GFP flags to zs_malloc() instead of using a fixed mask]
Link: http://lkml.kernel.org/r/20160429150942.GA637@swordfish
Link: http://lkml.kernel.org/r/20160429150942.GA637@swordfish
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>
Change-Id: I58cd72a0b1925203ec7d9a3962cc6c3422e8ac96
drivers/block/zram/zram_drv.c
include/linux/zsmalloc.h
mm/zsmalloc.c