Skip to content

Commit 110ceb8

Browse files
MiaoheLintorvalds
authored andcommitted
mm/zsmalloc.c: rework the list_add code in insert_zspage()
Rework the list_add code to make it more readable and simple. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Miaohe Lin <[email protected]> Acked-by: Minchan Kim <[email protected]> Reviewed-by: Sergey Senozhatsky <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 1ec3b5f commit 110ceb8

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

mm/zsmalloc.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -726,13 +726,10 @@ static void insert_zspage(struct size_class *class,
726726
* We want to see more ZS_FULL pages and less almost empty/full.
727727
* Put pages with higher ->inuse first.
728728
*/
729-
if (head) {
730-
if (get_zspage_inuse(zspage) < get_zspage_inuse(head)) {
731-
list_add(&zspage->list, &head->list);
732-
return;
733-
}
734-
}
735-
list_add(&zspage->list, &class->fullness_list[fullness]);
729+
if (head && get_zspage_inuse(zspage) < get_zspage_inuse(head))
730+
list_add(&zspage->list, &head->list);
731+
else
732+
list_add(&zspage->list, &class->fullness_list[fullness]);
736733
}
737734

738735
/*

0 commit comments

Comments
 (0)