]> git.baikalelectronics.ru Git - kernel.git/commit
zsmalloc: account the number of compacted pages
authorSergey Senozhatsky <sergey.senozhatsky@gmail.com>
Tue, 8 Sep 2015 22:04:38 +0000 (15:04 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Tue, 8 Sep 2015 22:35:28 +0000 (15:35 -0700)
commitd71ab675fb21fe56d5bc1bbb3f98e5dff15dd92c
treee46b5110aa65f7b75ed8c8b6e5fa97367f10c05a
parent3532fcdb63e56ef0d487a8ac157e72bfd175c236
zsmalloc: account the number of compacted pages

Compaction returns back to zram the number of migrated objects, which is
quite uninformative -- we have objects of different sizes so user space
cannot obtain any valuable data from that number.  Change compaction to
operate in terms of pages and return back to compaction issuer the
number of pages that were freed during compaction.  So from now on we
will export more meaningful value in zram<id>/mm_stat -- the number of
freed (compacted) pages.

This requires:
 (a) a rename of `num_migrated' to 'pages_compacted'
 (b) a internal API change -- return first_page's fullness_group from
     putback_zspage(), so we know when putback_zspage() did
     free_zspage().  It helps us to account compaction stats correctly.

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>
Documentation/blockdev/zram.txt
drivers/block/zram/zram_drv.c
include/linux/zsmalloc.h
mm/zsmalloc.c