Hi,
While working on KSM docs, I've noticed some minor points which are
addressed by the below patches.
Mike Rapoport (2):
mm/ksm: remove unused page_referenced_ksm declaration
mm/ksm: move [set_]page_stable_node from ksm.h to ksm.c
include/linux/ksm.h | 17 -----------------
mm/ksm.c | 12 ++++++++++++
2 files changed, 12 insertions(+), 17 deletions(-)
--
2.7.4
The page_stable_node() and set_page_stable_node() are only used in mm/ksm.c
and there is no point to keep them in the include/linux/ksm.h
Signed-off-by: Mike Rapoport <[email protected]>
---
include/linux/ksm.h | 11 -----------
mm/ksm.c | 12 ++++++++++++
2 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/include/linux/ksm.h b/include/linux/ksm.h
index bbdfca3..161e816 100644
--- a/include/linux/ksm.h
+++ b/include/linux/ksm.h
@@ -37,17 +37,6 @@ static inline void ksm_exit(struct mm_struct *mm)
__ksm_exit(mm);
}
-static inline struct stable_node *page_stable_node(struct page *page)
-{
- return PageKsm(page) ? page_rmapping(page) : NULL;
-}
-
-static inline void set_page_stable_node(struct page *page,
- struct stable_node *stable_node)
-{
- page->mapping = (void *)((unsigned long)stable_node | PAGE_MAPPING_KSM);
-}
-
/*
* When do_swap_page() first faults in from swap what used to be a KSM page,
* no problem, it will be assigned to this vma's anon_vma; but thereafter,
diff --git a/mm/ksm.c b/mm/ksm.c
index 16451a2..58c2741 100644
--- a/mm/ksm.c
+++ b/mm/ksm.c
@@ -827,6 +827,18 @@ static int unmerge_ksm_pages(struct vm_area_struct *vma,
/*
* Only called through the sysfs control interface:
*/
+
+static inline struct stable_node *page_stable_node(struct page *page)
+{
+ return PageKsm(page) ? page_rmapping(page) : NULL;
+}
+
+static inline void set_page_stable_node(struct page *page,
+ struct stable_node *stable_node)
+{
+ page->mapping = (void *)((unsigned long)stable_node | PAGE_MAPPING_KSM);
+}
+
static int remove_stable_node(struct stable_node *stable_node)
{
struct page *page;
--
2.7.4
The commit 9f32624be943538983e ("mm/rmap: use rmap_walk() in
page_referenced()") removed the declaration of page_referenced_ksm for the
case CONFIG_KSM=y, but left one for CONFIG_KSM=n.
Remove the unused leftover.
Signed-off-by: Mike Rapoport <[email protected]>
---
include/linux/ksm.h | 6 ------
1 file changed, 6 deletions(-)
diff --git a/include/linux/ksm.h b/include/linux/ksm.h
index 44368b1..bbdfca3 100644
--- a/include/linux/ksm.h
+++ b/include/linux/ksm.h
@@ -89,12 +89,6 @@ static inline struct page *ksm_might_need_to_copy(struct page *page,
return page;
}
-static inline int page_referenced_ksm(struct page *page,
- struct mem_cgroup *memcg, unsigned long *vm_flags)
-{
- return 0;
-}
-
static inline void rmap_walk_ksm(struct page *page,
struct rmap_walk_control *rwc)
{
--
2.7.4