diff options
author | Minchan Kim <minchan@kernel.org> | 2015-04-15 19:16:18 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-15 19:35:22 -0400 |
commit | 839373e645d12613308d9148041c4bd967bce8d5 (patch) | |
tree | 79a29675e15f8eb8bd4fcca5f035a96b2154e049 /mm | |
parent | 495819ead5ad02174208994ca610852a7791a2f2 (diff) |
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: Heesub Shin <heesub.shin@samsung.com>
Signed-off-by: Minchan 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: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r-- | mm/zsmalloc.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index a9a9ff233a13..ded3672295d7 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c | |||
@@ -1678,14 +1678,14 @@ static struct page *alloc_target_page(struct size_class *class) | |||
1678 | static void putback_zspage(struct zs_pool *pool, struct size_class *class, | 1678 | static void putback_zspage(struct zs_pool *pool, struct size_class *class, |
1679 | struct page *first_page) | 1679 | struct page *first_page) |
1680 | { | 1680 | { |
1681 | int class_idx; | ||
1682 | enum fullness_group fullness; | 1681 | enum fullness_group fullness; |
1683 | 1682 | ||
1684 | BUG_ON(!is_first_page(first_page)); | 1683 | BUG_ON(!is_first_page(first_page)); |
1685 | 1684 | ||
1686 | get_zspage_mapping(first_page, &class_idx, &fullness); | 1685 | fullness = get_fullness_group(first_page); |
1687 | insert_zspage(first_page, class, fullness); | 1686 | insert_zspage(first_page, class, fullness); |
1688 | fullness = fix_fullness_group(class, first_page); | 1687 | set_zspage_mapping(first_page, class->index, fullness); |
1688 | |||
1689 | if (fullness == ZS_EMPTY) { | 1689 | if (fullness == ZS_EMPTY) { |
1690 | zs_stat_dec(class, OBJ_ALLOCATED, get_maxobj_per_zspage( | 1690 | zs_stat_dec(class, OBJ_ALLOCATED, get_maxobj_per_zspage( |
1691 | class->size, class->pages_per_zspage)); | 1691 | class->size, class->pages_per_zspage)); |