提交 839373e6 编写于 作者: M Minchan Kim 提交者: Linus Torvalds

zsmalloc: remove unnecessary insertion/removal of zspage in compaction

In putback_zspage, we don't need to insert a zspage into list of zspage
in size_class again to just fix fullness group. We could do directly
without reinsertion so we could save some instuctions.
Reported-by: NHeesub Shin <heesub.shin@samsung.com>
Signed-off-by: NMinchan Kim <minchan@kernel.org>
Cc: Nitin Gupta <ngupta@vflare.org>
Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Dan Streetman <ddstreet@ieee.org>
Cc: Seth Jennings <sjennings@variantweb.net>
Cc: Ganesh Mahendran <opensource.ganesh@gmail.com>
Cc: Luigi Semenzato <semenzato@google.com>
Cc: Gunho Lee <gunho.lee@lge.com>
Cc: Juneho Choi <juno.choi@lge.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 495819ea
......@@ -1678,14 +1678,14 @@ static struct page *alloc_target_page(struct size_class *class)
static void putback_zspage(struct zs_pool *pool, struct size_class *class,
struct page *first_page)
{
int class_idx;
enum fullness_group fullness;
BUG_ON(!is_first_page(first_page));
get_zspage_mapping(first_page, &class_idx, &fullness);
fullness = get_fullness_group(first_page);
insert_zspage(first_page, class, fullness);
fullness = fix_fullness_group(class, first_page);
set_zspage_mapping(first_page, class->index, fullness);
if (fullness == ZS_EMPTY) {
zs_stat_dec(class, OBJ_ALLOCATED, get_maxobj_per_zspage(
class->size, class->pages_per_zspage));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册