* [merged mm-stable] mm-huge_memory-convert-split_huge_pages_all-to-use-a-folio.patch removed from -mm tree
@ 2023-01-19 1:15 Andrew Morton
0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2023-01-19 1:15 UTC (permalink / raw)
To: mm-commits, willy, mike.kravetz, wangkefeng.wang, akpm
The quilt patch titled
Subject: mm: huge_memory: convert split_huge_pages_all() to use a folio
has been removed from the -mm tree. Its filename was
mm-huge_memory-convert-split_huge_pages_all-to-use-a-folio.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: Kefeng Wang <wangkefeng.wang@huawei.com>
Subject: mm: huge_memory: convert split_huge_pages_all() to use a folio
Date: Thu, 29 Dec 2022 20:25:03 +0800
Straightforwardly convert split_huge_pages_all() to use a folio.
Link: https://lkml.kernel.org/r/20221229122503.149083-1-wangkefeng.wang@huawei.com
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Cc: Mike Kravetz <mike.kravetz@oracle.com>
Cc: Matthew Wilcox <willy@infradead.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---
mm/huge_memory.c | 25 +++++++++++++++++--------
1 file changed, 17 insertions(+), 8 deletions(-)
--- a/mm/huge_memory.c~mm-huge_memory-convert-split_huge_pages_all-to-use-a-folio
+++ a/mm/huge_memory.c
@@ -2935,6 +2935,7 @@ static void split_huge_pages_all(void)
{
struct zone *zone;
struct page *page;
+ struct folio *folio;
unsigned long pfn, max_zone_pfn;
unsigned long total = 0, split = 0;
@@ -2947,24 +2948,32 @@ static void split_huge_pages_all(void)
int nr_pages;
page = pfn_to_online_page(pfn);
- if (!page || !get_page_unless_zero(page))
+ if (!page || PageTail(page))
continue;
+ folio = page_folio(page);
+ if (!folio_try_get(folio))
+ continue;
+
+ if (unlikely(page_folio(page) != folio))
+ goto next;
- if (zone != page_zone(page))
+ if (zone != folio_zone(folio))
goto next;
- if (!PageHead(page) || PageHuge(page) || !PageLRU(page))
+ if (!folio_test_large(folio)
+ || folio_test_hugetlb(folio)
+ || !folio_test_lru(folio))
goto next;
total++;
- lock_page(page);
- nr_pages = thp_nr_pages(page);
- if (!split_huge_page(page))
+ folio_lock(folio);
+ nr_pages = folio_nr_pages(folio);
+ if (!split_folio(folio))
split++;
pfn += nr_pages - 1;
- unlock_page(page);
+ folio_unlock(folio);
next:
- put_page(page);
+ folio_put(folio);
cond_resched();
}
}
_
Patches currently in -mm which might be from wangkefeng.wang@huawei.com are
mm-hwposion-support-recovery-from-ksm_might_need_to_copy.patch
mm-hwposion-support-recovery-from-ksm_might_need_to_copy-v3.patch
mm-madvise-use-vm_normal_folio-in-madvise_free_pte_range.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-01-19 1:20 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-19 1:15 [merged mm-stable] mm-huge_memory-convert-split_huge_pages_all-to-use-a-folio.patch removed from -mm tree Andrew Morton
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.