Skip to content

Commit

Permalink
UPSTREAM: zsmalloc: remove unnecessary insertion/removal of zspage in…
Browse files Browse the repository at this point in the history
… compaction

(cherry-pick from commit 839373e645d12613308d9148041c4bd967bce8d5)

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.

Bug: 25951511

Change-Id: I07ad8bac6d2f5dc90ac0d492626e067a02699979
Reported-by: Heesub Shin <[email protected]>
Signed-off-by: Minchan Kim <[email protected]>
Cc: Nitin Gupta <[email protected]>
Cc: Sergey Senozhatsky <[email protected]>
Cc: Dan Streetman <[email protected]>
Cc: Seth Jennings <[email protected]>
Cc: Ganesh Mahendran <[email protected]>
Cc: Luigi Semenzato <[email protected]>
Cc: Gunho Lee <[email protected]>
Cc: Juneho Choi <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Signed-off-by: Francisco Franco <[email protected]>
  • Loading branch information
minchank authored and elektroschmock committed Oct 30, 2018
1 parent f42d969 commit d562a5e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mm/zsmalloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1679,14 +1679,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));
Expand Down

0 comments on commit d562a5e

Please sign in to comment.