BACKPORT: zram: add free space management in backing device
authorMinchan Kim <minchan@kernel.org>
Wed, 6 Sep 2017 23:19:57 +0000 (16:19 -0700)
committerivanmeler <i_ivan@windowslive.com>
Wed, 13 Apr 2022 21:13:24 +0000 (21:13 +0000)
commit19bee0d5798db292409655dae1e6bc11e36a3bfb
tree33e00e7e1839a71c72ed4872d526489d9171bcc5
parentd70dcf75b1ba3b8ac083290c1542722aa5846b2e
BACKPORT: zram: add free space management in backing device

With backing device, zram needs management of free space of backing
device.

This patch adds bitmap logic to manage free space which is very naive.
However, it would be simple enough as considering uncompressible pages's
frequenty in zram.

Link: http://lkml.kernel.org/r/1498459987-24562-6-git-send-email-minchan@kernel.org
Signed-off-by: Minchan Kim <minchan@kernel.org>
Cc: Juneho Choi <juno.choi@lge.com>
Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
(cherry picked from commit 1363d4662a0d28dfdb81ef426c88c9a8dbf7c338)
Signed-off-by: Peter Kalauskas <peskal@google.com>
Bug: 112488418
Change-Id: I37dc98b40bfddceb9eb6d989ca30683dbf89210c
drivers/block/zram/zram_drv.c
drivers/block/zram/zram_drv.h