[RFC v5 06/11] mm/rmap: Export essential functions for rmap_run

From: SeongJae Park
Date: Tue Jul 07 2020 - 10:48:53 EST


From: SeongJae Park <sjpark@xxxxxxxxx>

This commit exports the three essential functions for ramp walk,
'page_lock_anon_vma_read()', 'rmap_walk()', and 'page_rmapping()', to
GPL modules. Those will be used by DAMON for the physical memory
address based access monitoring in the following commit.

Signed-off-by: SeongJae Park <sjpark@xxxxxxxxx>
---
mm/rmap.c | 2 ++
mm/util.c | 1 +
2 files changed, 3 insertions(+)

diff --git a/mm/rmap.c b/mm/rmap.c
index f79a206b271a..20ac37b27a7d 100644
--- a/mm/rmap.c
+++ b/mm/rmap.c
@@ -579,6 +579,7 @@ struct anon_vma *page_lock_anon_vma_read(struct page *page)
rcu_read_unlock();
return anon_vma;
}
+EXPORT_SYMBOL_GPL(page_lock_anon_vma_read);

void page_unlock_anon_vma_read(struct anon_vma *anon_vma)
{
@@ -1934,6 +1935,7 @@ void rmap_walk(struct page *page, struct rmap_walk_control *rwc)
else
rmap_walk_file(page, rwc, false);
}
+EXPORT_SYMBOL_GPL(rmap_walk);

/* Like rmap_walk, but caller holds relevant rmap lock */
void rmap_walk_locked(struct page *page, struct rmap_walk_control *rwc)
diff --git a/mm/util.c b/mm/util.c
index 988d11e6c17c..1df32546fe28 100644
--- a/mm/util.c
+++ b/mm/util.c
@@ -620,6 +620,7 @@ void *page_rmapping(struct page *page)
page = compound_head(page);
return __page_rmapping(page);
}
+EXPORT_SYMBOL_GPL(page_rmapping);

/*
* Return true if this page is mapped into pagetables.
--
2.17.1