]> git.baikalelectronics.ru Git - kernel.git/commit
mm/zsmalloc: avoid calculate max objects of zspage twice
authorGanesh Mahendran <opensource.ganesh@gmail.com>
Thu, 28 Jul 2016 22:47:51 +0000 (15:47 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 28 Jul 2016 23:07:41 +0000 (16:07 -0700)
commita3bec0f04a2d29ef26f5ab26260e9edf6728c9e7
treee11e75ae92f8f4df349115af4c136c46e75de330
parent51dec54ae117f69e795f1edf5ff4d2a3944bc77a
mm/zsmalloc: avoid calculate max objects of zspage twice

Currently, if a class can not be merged, the max objects of zspage in
that class may be calculated twice.

This patch calculate max objects of zspage at the begin, and pass the
value to can_merge() to decide whether the class can be merged.

Also this patch remove function get_maxobj_per_zspage(), as there is no
other place to call this function.

Link: http://lkml.kernel.org/r/1467882338-4300-4-git-send-email-opensource.ganesh@gmail.com
Signed-off-by: Ganesh Mahendran <opensource.ganesh@gmail.com>
Reviewed-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>
mm/zsmalloc.c