10 #include <linux/bitops.h>
14 #include <linux/sched.h>
24 unsigned long end,
int advice,
unsigned long *
vm_flags);
35 static inline void ksm_exit(
struct mm_struct *mm)
47 static inline int PageKsm(
struct page *
page)
49 return ((
unsigned long)page->
mapping & PAGE_MAPPING_FLAGS) ==
50 (PAGE_MAPPING_ANON | PAGE_MAPPING_KSM);
53 static inline struct stable_node *page_stable_node(
struct page *page)
55 return PageKsm(page) ? page_rmapping(page) :
NULL;
58 static inline void set_page_stable_node(
struct page *page,
61 page->
mapping = (
void *)stable_node +
62 (PAGE_MAPPING_ANON | PAGE_MAPPING_KSM);
76 static inline int ksm_might_need_to_copy(
struct page *page,
83 page->
index != linear_page_index(vma, address));
89 int rmap_walk_ksm(
struct page *page,
int (*rmap_one)(
struct page *,
91 void ksm_migrate_page(
struct page *newpage,
struct page *oldpage);
100 static inline void ksm_exit(
struct mm_struct *mm)
104 static inline int PageKsm(
struct page *page)
111 unsigned long end,
int advice,
unsigned long *
vm_flags)
116 static inline int ksm_might_need_to_copy(
struct page *page,
133 static inline int rmap_walk_ksm(
struct page *page,
int (*rmap_one)(
struct page*,
139 static inline void ksm_migrate_page(
struct page *newpage,
struct page *oldpage)