mm-zsmalloc-stop-using-__clearpagemovable.patch removed from -mm tree
The quilt patch titled
Subject: mm/zsmalloc: stop using __ClearPageMovable()
has been removed from the -mm tree. Its filename was
mm-zsmalloc-stop-using-__clearpagemovable.patch
This patch was dropped because it was merged into the mm-stable branch of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
------------------------------------------------------
From: David Hildenbrand <[email protected]>
Subject: mm/zsmalloc: stop using __ClearPageMovable()
Date: Fri, 4 Jul 2025 12:25:06 +0200
Instead, let's check in the callbacks if the page was already destroyed, which can be checked by looking at zpdesc->zspage (see reset_zpdesc()).
If we detect that the page was destroyed:
(1) Fail isolation, just like the migration core would
(2) Fake migration success just like the migration core would
In the putback case there is nothing to do, as we don't do anything just like the migration core would do.
In the future, we should look into not letting these pages get destroyed while they are isolated -- and instead delaying that to the putback/migration call. Add a TODO for that.
---
mm/zsmalloc.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-)
mm/zsmalloc.c renamed from mm/zsmalloc.c~mm-zsmalloc-stop-using-__clearpagemovable +14 -4
@@ -877,7 +877,6 @@ static void reset_zpdesc(struct zpdesc * {struct page *page =zpdesc_page (zpdesc); -__ClearPageMovable (page);ClearPagePrivate (page); zpdesc->zspage =NULL ; zpdesc->next =NULL ;
@@ -1716,10 +1715,11 @@ static void replace_sub_page(struct sizestatic bool zs_page_isolate (struct page *page,isolate_mode_t mode) {/* -* Page is locked so zspage couldn't be destroyed. For detail, look at -* lock_zspage in free_zspage. +* Page is locked so zspage can't be destroyed concurrently +* (see free_zspage()). But if the page was already destroyed +* (see reset_zpdesc()), refuse isolation here. */ -return true; +return page_zpdesc (page)->zspage; } static int zs_page_migrate(struct page *newpage, struct page *page,
@@ -1737,6 +1737,16 @@ static int zs_page_migrate(struct page *unsigned long old_obj, new_obj;unsigned int obj_idx; +/* +* TODO: nothing prevents a zspage from getting destroyed while +* it is isolated for migration, as the page lock is temporarily +* dropped after zs_page_isolate() succeeded: we should rework that +* and defer destroying such pages once they are un-isolated (putback) +* instead. +*/ +if (!zpdesc->zspage) +return MIGRATEPAGE_SUCCESS ; +/* The page is locked, so this pointer must remain valid */ zspage =get_zspage (zpdesc); pool = zspage->pool;
_
Patches currently in -mm which might be from [email protected] are
mm-convert-fpb_ignore_-into-fpb_respect_.patch mm-smaller-folio_pte_batch-improvements.patch mm-split-folio_pte_batch-into-folio_pte_batch-and-folio_pte_batch_flags.patch mm-remove-boolean-output-parameters-from-folio_pte_batch_ext.patch mm-memory-introduce-is_huge_zero_pfn-and-use-it-in-vm_normal_page_pmd.patch