Commit 6199277b authored by Matthew Wilcox (Oracle)'s avatar Matthew Wilcox (Oracle) Committed by Andrew Morton

mm: remove folio_test_transhuge()

This function is misleading; people think it means "Is this a THP", when
all it actually does is check whether this is a large folio.  Remove it;
the one remaining user should have been checking to see whether the folio
is PMD sized or not.

Link: https://lkml.kernel.org/r/20230816151201.3655946-12-willy@infradead.orgSigned-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
Cc: David Hildenbrand <david@redhat.com>
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Sidhartha Kumar <sidhartha.kumar@oracle.com>
Cc: Yanteng Si <siyanteng@loongson.cn>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent ebc1baf5
...@@ -853,11 +853,6 @@ static inline int PageTransHuge(struct page *page) ...@@ -853,11 +853,6 @@ static inline int PageTransHuge(struct page *page)
return PageHead(page); return PageHead(page);
} }
static inline bool folio_test_transhuge(struct folio *folio)
{
return folio_test_head(folio);
}
/* /*
* PageTransCompound returns true for both transparent huge pages * PageTransCompound returns true for both transparent huge pages
* and hugetlbfs pages, so it should only be called when it's known * and hugetlbfs pages, so it should only be called when it's known
......
...@@ -5755,7 +5755,7 @@ static int mem_cgroup_move_account(struct page *page, ...@@ -5755,7 +5755,7 @@ static int mem_cgroup_move_account(struct page *page,
if (folio_mapped(folio)) { if (folio_mapped(folio)) {
__mod_lruvec_state(from_vec, NR_ANON_MAPPED, -nr_pages); __mod_lruvec_state(from_vec, NR_ANON_MAPPED, -nr_pages);
__mod_lruvec_state(to_vec, NR_ANON_MAPPED, nr_pages); __mod_lruvec_state(to_vec, NR_ANON_MAPPED, nr_pages);
if (folio_test_transhuge(folio)) { if (folio_test_pmd_mappable(folio)) {
__mod_lruvec_state(from_vec, NR_ANON_THPS, __mod_lruvec_state(from_vec, NR_ANON_THPS,
-nr_pages); -nr_pages);
__mod_lruvec_state(to_vec, NR_ANON_THPS, __mod_lruvec_state(to_vec, NR_ANON_THPS,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment