Commit 22c5cef1 authored by Yisheng Xie's avatar Yisheng Xie Committed by Linus Torvalds
Browse files

mm/zsmalloc: remove redundant SetPagePrivate2 in create_page_chain

We had used page->lru to link the component pages (except the first
page) of a zspage, and used INIT_LIST_HEAD(&page->lru) to init it.
Therefore, to get the last page's next page, which is NULL, we had to
use page flag PG_Private_2 to identify it.

But now, we use page->freelist to link all of the pages in zspage and
init the page->freelist as NULL for last page, so no need to use
PG_Private_2 anymore.

This remove redundant SetPagePrivate2 in create_page_chain and
ClearPagePrivate2 in reset_page().  Save a few cycles for migration of
zsmalloc page :)


Signed-off-by: default avatarYisheng Xie <>
Reviewed-by: default avatarSergey Senozhatsky <>
Acked-by: default avatarMinchan Kim <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent e1587a49
......@@ -24,7 +24,6 @@
* Usage of struct page flags:
* PG_private: identifies the first component page
* PG_private2: identifies the last component page
* PG_owner_priv_1: identifies the huge component page
......@@ -938,7 +937,6 @@ static void reset_page(struct page *page)
set_page_private(page, 0);
......@@ -1085,7 +1083,7 @@ static void create_page_chain(struct size_class *class, struct zspage *zspage,
* 2. each sub-page point to zspage using page->private
* we set PG_private to identify the first page (i.e. no other sub-page
* has this flag set) and PG_private_2 to identify the last page.
* has this flag set).
for (i = 0; i < nr_pages; i++) {
page = pages[i];
......@@ -1100,8 +1098,6 @@ static void create_page_chain(struct size_class *class, struct zspage *zspage,
} else {
prev_page->freelist = page;
if (i == nr_pages - 1)
prev_page = page;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment