linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] hugetlb: Use a folio in free_hpage_workfn()
@ 2023-08-22 16:28 Matthew Wilcox (Oracle)
  2023-08-22 16:28 ` [PATCH 2/3] hugetlb: Remove a few calls to page_folio() Matthew Wilcox (Oracle)
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Matthew Wilcox (Oracle) @ 2023-08-22 16:28 UTC (permalink / raw)
  To: Mike Kravetz
  Cc: Matthew Wilcox (Oracle), Muchun Song, linux-mm, Sidhartha Kumar

update_and_free_hugetlb_folio puts the memory on hpage_freelist as a folio
so we can take it off the list as a folio.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Cc: Sidhartha Kumar <sidhartha.kumar@oracle.com>
---
 mm/hugetlb.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/mm/hugetlb.c b/mm/hugetlb.c
index a82c3104337e..d1c856628bac 100644
--- a/mm/hugetlb.c
+++ b/mm/hugetlb.c
@@ -1786,22 +1786,22 @@ static void free_hpage_workfn(struct work_struct *work)
 	node = llist_del_all(&hpage_freelist);
 
 	while (node) {
-		struct page *page;
+		struct folio *folio;
 		struct hstate *h;
 
-		page = container_of((struct address_space **)node,
-				     struct page, mapping);
+		folio = container_of((struct address_space **)node,
+				     struct folio, mapping);
 		node = node->next;
-		page->mapping = NULL;
+		folio->mapping = NULL;
 		/*
 		 * The VM_BUG_ON_FOLIO(!folio_test_hugetlb(folio), folio) in
 		 * folio_hstate() is going to trigger because a previous call to
 		 * remove_hugetlb_folio() will clear the hugetlb bit, so do
 		 * not use folio_hstate() directly.
 		 */
-		h = size_to_hstate(page_size(page));
+		h = size_to_hstate(folio_size(folio));
 
-		__update_and_free_hugetlb_folio(h, page_folio(page));
+		__update_and_free_hugetlb_folio(h, folio);
 
 		cond_resched();
 	}
-- 
2.40.1



^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2023-10-13  9:06 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-22 16:28 [PATCH 1/3] hugetlb: Use a folio in free_hpage_workfn() Matthew Wilcox (Oracle)
2023-08-22 16:28 ` [PATCH 2/3] hugetlb: Remove a few calls to page_folio() Matthew Wilcox (Oracle)
2023-08-23 22:41   ` Mike Kravetz
2023-08-24  2:59   ` Muchun Song
2023-08-24 13:59   ` kernel test robot
2023-10-13  9:06   ` Dan Carpenter
2023-08-22 16:28 ` [PATCH 3/3] hugetlb: Convert remove_pool_huge_page() to return a folio Matthew Wilcox (Oracle)
2023-08-23 22:48   ` Mike Kravetz
2023-08-24  1:10     ` Matthew Wilcox
2023-08-24  2:38       ` Muchun Song
2023-08-23 22:37 ` [PATCH 1/3] hugetlb: Use a folio in free_hpage_workfn() Mike Kravetz
2023-08-24  2:58 ` Muchun Song

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox