Re: [PATCH 7/9] mm: Add deferred_list page flag

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 15.08.23 05:26, Matthew Wilcox (Oracle) wrote:
Stored in the first tail page's flags, this flag replaces the destructor.
That removes the last of the destructors, so remove all references to
folio_dtor and compound_dtor.

Signed-off-by: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx>
---

[...]

+ /* Has a deferred list (may be empty). First tail page. */
+	PG_deferred_list = PG_reclaim,
+

If PG_deferred_list implies thp (and replaces the thp dtor), should we rather name this PG_thp or something along those lines?

[...]

diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 21af71aea6eb..9fe9209605a5 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -582,9 +582,6 @@ static inline void free_the_page(struct page *page, unsigned int order)
   * The remaining PAGE_SIZE pages are called "tail pages". PageTail() is encoded
   * in bit 0 of page->compound_head. The rest of bits is pointer to head page.
   *
- * The first tail page's ->compound_dtor describes how to destroy the
- * compound page.
- *
   * The first tail page's ->compound_order holds the order of allocation.
   * This usage means that zero-order pages may not be compound.
   */
@@ -603,14 +600,12 @@ void prep_compound_page(struct page *page, unsigned int order)
void destroy_large_folio(struct folio *folio)
  {
-	enum compound_dtor_id dtor = folio->_folio_dtor;
-
  	if (folio_test_hugetlb(folio)) {
  		free_huge_page(folio);
  		return;
  	}
- if (folio_test_transhuge(folio) && dtor == TRANSHUGE_PAGE_DTOR)
+	if (folio_test_deferred_list(folio))

Similar question as before: why not have folio_test_transhuge() perform this check internally?

The sequence of

	if (folio_test_deferred_list(folio))
		free_transhuge_folio(folio);

Looks less clear to what we had before.

--
Cheers,

David / dhildenb





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux