[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180919051846.234615-1-minchan@kernel.org>
Date: Wed, 19 Sep 2018 14:18:46 +0900
From: Minchan Kim <minchan@...nel.org>
To: LKML <linux-kernel@...r.kernel.org>,
Andrew Morton <akpm@...ux-foundation.org>
Cc: Minchan Kim <minchan@...nel.org>,
Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>,
stable@...r.kernel.org
Subject: [PATCH] zram: fix missing zero pages for memory tracking
We need to count zero filled pages as well as other pages in zram.
Otherwise, it doesn't match swap page count via pagemap of process
so that memory tracking feature in zram doesn't provide accurate
information.
Cc: Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>
Cc: <stable@...r.kernel.org> [4.18+]
Signed-off-by: Minchan Kim <minchan@...nel.org>
---
drivers/block/zram/zram_drv.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index a1d6b5597c17..40d303d8826f 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@ -71,7 +71,7 @@ static inline bool init_done(struct zram *zram)
static inline bool zram_allocated(struct zram *zram, u32 index)
{
- return (zram->table[index].value >> (ZRAM_FLAG_SHIFT + 1)) ||
+ return zram->table[index].value >> ZRAM_FLAG_SHIFT ||
zram->table[index].handle;
}
--
2.19.0.397.gdd90340f6a-goog
Powered by blists - more mailing lists