From: "Matthew Wilcox (Oracle)" <willy@infradead.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org>,
linux-mm@kvack.org, linux-fsdevel@vger.kernel.org,
x86@kernel.org
Subject: [PATCH 05/10] mm: Remove PageUnevictable
Date: Wed, 21 Aug 2024 20:34:38 +0100 [thread overview]
Message-ID: <20240821193445.2294269-6-willy@infradead.org> (raw)
In-Reply-To: <20240821193445.2294269-1-willy@infradead.org>
There is only one caller of PageUnevictable() left; convert it to call
folio_test_unevictable() and remove all the page accessors.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
include/linux/page-flags.h | 6 +++---
mm/huge_memory.c | 16 ++++++++--------
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 43a7996c53d4..bdf24f65d998 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -580,9 +580,9 @@ FOLIO_CLEAR_FLAG(swapcache, FOLIO_HEAD_PAGE)
FOLIO_FLAG_FALSE(swapcache)
#endif
-PAGEFLAG(Unevictable, unevictable, PF_HEAD)
- __CLEARPAGEFLAG(Unevictable, unevictable, PF_HEAD)
- TESTCLEARFLAG(Unevictable, unevictable, PF_HEAD)
+FOLIO_FLAG(unevictable, FOLIO_HEAD_PAGE)
+ __FOLIO_CLEAR_FLAG(unevictable, FOLIO_HEAD_PAGE)
+ FOLIO_TEST_CLEAR_FLAG(unevictable, FOLIO_HEAD_PAGE)
#ifdef CONFIG_MMU
PAGEFLAG(Mlocked, mlocked, PF_NO_TAIL)
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index cf8e34f62976..d92f19812c89 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -3017,25 +3017,25 @@ static void remap_page(struct folio *folio, unsigned long nr)
}
}
-static void lru_add_page_tail(struct page *head, struct page *tail,
+static void lru_add_page_tail(struct folio *folio, struct page *tail,
struct lruvec *lruvec, struct list_head *list)
{
- VM_BUG_ON_PAGE(!PageHead(head), head);
- VM_BUG_ON_PAGE(PageLRU(tail), head);
+ VM_BUG_ON_FOLIO(!folio_test_large(folio), folio);
+ VM_BUG_ON_FOLIO(PageLRU(tail), folio);
lockdep_assert_held(&lruvec->lru_lock);
if (list) {
/* page reclaim is reclaiming a huge page */
- VM_WARN_ON(PageLRU(head));
+ VM_WARN_ON(folio_test_lru(folio));
get_page(tail);
list_add_tail(&tail->lru, list);
} else {
/* head is still on lru (and we have it frozen) */
- VM_WARN_ON(!PageLRU(head));
- if (PageUnevictable(tail))
+ VM_WARN_ON(!folio_test_lru(folio));
+ if (folio_test_unevictable(folio))
tail->mlock_count = 0;
else
- list_add_tail(&tail->lru, &head->lru);
+ list_add_tail(&tail->lru, &folio->lru);
SetPageLRU(tail);
}
}
@@ -3134,7 +3134,7 @@ static void __split_huge_page_tail(struct folio *folio, int tail,
* pages to show after the currently processed elements - e.g.
* migrate_pages
*/
- lru_add_page_tail(head, page_tail, lruvec, list);
+ lru_add_page_tail(folio, page_tail, lruvec, list);
}
static void __split_huge_page(struct page *page, struct list_head *list,
--
2.43.0
next prev parent reply other threads:[~2024-08-21 19:35 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-21 19:34 [PATCH 00/10] Simplify the page flags a little Matthew Wilcox (Oracle)
2024-08-21 19:34 ` [PATCH 01/10] mm: Remove PageActive Matthew Wilcox (Oracle)
2024-08-22 13:22 ` kernel test robot
2024-08-22 18:24 ` Andrew Morton
2024-08-22 18:34 ` Matthew Wilcox
2024-08-22 15:47 ` kernel test robot
2024-08-21 19:34 ` [PATCH 02/10] mm: Remove PageSwapBacked Matthew Wilcox (Oracle)
2024-08-21 19:34 ` [PATCH 03/10] mm: Remove PageReadahead Matthew Wilcox (Oracle)
2024-08-21 19:34 ` [PATCH 04/10] mm: Remove PageSwapCache Matthew Wilcox (Oracle)
2024-08-21 19:34 ` Matthew Wilcox (Oracle) [this message]
2024-08-21 19:34 ` [PATCH 06/10] mm: Remove PageMlocked Matthew Wilcox (Oracle)
2024-08-21 19:34 ` [PATCH 07/10] mm: Remove PageOwnerPriv1 Matthew Wilcox (Oracle)
2024-08-21 19:34 ` [PATCH 08/10] mm: Remove page_has_private() Matthew Wilcox (Oracle)
2024-08-21 19:34 ` [PATCH 09/10] mm: Rename PG_mappedtodisk to PG_owner_2 Matthew Wilcox (Oracle)
2024-08-21 19:34 ` [PATCH 10/10] x86: Remove PG_uncached Matthew Wilcox (Oracle)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240821193445.2294269-6-willy@infradead.org \
--to=willy@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).