@@ -867,12 +867,14 @@ static inline bool obj_allocated(struct zpdesc *zpdesc, void *obj,
return true;
}
-static void reset_page(struct page *page)
+static void reset_zpdesc(struct zpdesc *zpdesc)
{
+ struct page *page = zpdesc_page(zpdesc);
+
__ClearPageMovable(page);
ClearPagePrivate(page);
- set_page_private(page, 0);
- page->index = 0;
+ zpdesc->zspage = NULL;
+ zpdesc->next = NULL;
reset_first_obj_offset(page);
__ClearPageZsmalloc(page);
}
@@ -912,7 +914,7 @@ static void __free_zspage(struct zs_pool *pool, struct size_class *class,
do {
VM_BUG_ON_PAGE(!PageLocked(page), page);
next = get_next_page(page);
- reset_page(page);
+ reset_zpdesc(page_zpdesc(page));
unlock_page(page);
dec_zone_page_state(page, NR_ZSPAGES);
put_page(page);
@@ -1904,7 +1906,7 @@ static int zs_page_migrate(struct page *newpage, struct page *page,
zpdesc_inc_zone_page_state(newzpdesc);
}
- reset_page(page);
+ reset_zpdesc(zpdesc);
zpdesc_put(zpdesc);
return MIGRATEPAGE_SUCCESS;