summaryrefslogtreecommitdiff
path: root/mm/workingset.c
diff options
context:
space:
mode:
authorMatthew Wilcox (Oracle) <willy@infradead.org>2021-05-04 17:19:13 -0400
committerMatthew Wilcox (Oracle) <willy@infradead.org>2021-09-27 09:27:32 -0400
commitc5ce619a77ce00d537ef512e7a823c99ce890a40 (patch)
tree07adb45b8d53353efcdee1782a41e3c76772e0b1 /mm/workingset.c
parent0de340cbed3359423e38ed49242ac9d6986b5cfd (diff)
downloadlinux-rpi-c5ce619a77ce00d537ef512e7a823c99ce890a40.tar.gz
linux-rpi-c5ce619a77ce00d537ef512e7a823c99ce890a40.tar.bz2
linux-rpi-c5ce619a77ce00d537ef512e7a823c99ce890a40.zip
mm/workingset: Convert workingset_activation to take a folio
This function already assumed it was being passed a head page. No real change here, except that thp_nr_pages() compiles away on kernels with THP compiled out while folio_nr_pages() is always present. Also convert page_memcg_rcu() to folio_memcg_rcu(). Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Reviewed-by: Christoph Hellwig <hch@lst.de> Reviewed-by: David Howells <dhowells@redhat.com> Acked-by: Vlastimil Babka <vbabka@suse.cz>
Diffstat (limited to 'mm/workingset.c')
-rw-r--r--mm/workingset.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/mm/workingset.c b/mm/workingset.c
index 3deb408a240d..1c96ed525a0e 100644
--- a/mm/workingset.c
+++ b/mm/workingset.c
@@ -393,13 +393,11 @@ out:
/**
* workingset_activation - note a page activation
- * @page: page that is being activated
+ * @folio: Folio that is being activated.
*/
-void workingset_activation(struct page *page)
+void workingset_activation(struct folio *folio)
{
- struct folio *folio = page_folio(page);
struct mem_cgroup *memcg;
- struct lruvec *lruvec;
rcu_read_lock();
/*
@@ -409,11 +407,10 @@ void workingset_activation(struct page *page)
* XXX: See workingset_refault() - this should return
* root_mem_cgroup even for !CONFIG_MEMCG.
*/
- memcg = page_memcg_rcu(page);
+ memcg = folio_memcg_rcu(folio);
if (!mem_cgroup_disabled() && !memcg)
goto out;
- lruvec = folio_lruvec(folio);
- workingset_age_nonresident(lruvec, thp_nr_pages(page));
+ workingset_age_nonresident(folio_lruvec(folio), folio_nr_pages(folio));
out:
rcu_read_unlock();
}