zsmalloc: Rework the list_add code in insert_zspage()
Subsystems (2)
PATCH 1/1 zsmalloc: Rework the list_add code in insert_zspage()
Rework the list_add code to make it more readable and simplicity.
Signed-off-by Miaohe Lin <[email protected]>
--- mm/zsmalloc.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-)
mm/zsmalloc.c +4 -7
@@ -730,13 +730,10 @@ static void insert_zspage(struct size_class *class,* We want to see more ZS_FULL pages and less almost empty/full. * Put pages with higher ->inuse first. */ -if (head) { -if (get_zspage_inuse (zspage) <get_zspage_inuse (head)) { -list_add (&zspage->list, &head->list); -return ; - } - } -list_add (&zspage->list, &class->fullness_list[fullness]); +if (head &&get_zspage_inuse (zspage) <get_zspage_inuse (head)) +list_add (&zspage->list, &head->list); +else +list_add (&zspage->list, &class->fullness_list[fullness]); }/*
Signature · 1 line
2.19.1
Quoted 3 lines · Miaohe Lin
Rework the
list_addcode to make it more readable and simplicity.Signed-off-by Miaohe Lin <[email protected]>
Acked-by Minchan Kim <[email protected]>
Sergey Senozhatsky
Reviewed-byQuoted 5 lines · Minchan Kim
Quoted 3 lines · Miaohe Lin
Rework the
list_addcode to make it more readable and simplicity.Signed-off-by Miaohe Lin <[email protected]>Acked-by Minchan Kim <[email protected]>
Reviewed-by Sergey Senozhatsky <[email protected]>
-ss