Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
ksm.c File Reference
#include <linux/errno.h>
#include <linux/mm.h>
#include <linux/fs.h>
#include <linux/mman.h>
#include <linux/sched.h>
#include <linux/rwsem.h>
#include <linux/pagemap.h>
#include <linux/rmap.h>
#include <linux/spinlock.h>
#include <linux/jhash.h>
#include <linux/delay.h>
#include <linux/kthread.h>
#include <linux/wait.h>
#include <linux/slab.h>
#include <linux/rbtree.h>
#include <linux/memory.h>
#include <linux/mmu_notifier.h>
#include <linux/swap.h>
#include <linux/ksm.h>
#include <linux/hash.h>
#include <linux/freezer.h>
#include <linux/oom.h>
#include <asm/tlbflush.h>
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  mm_slot
 
struct  ksm_scan
 
struct  stable_node
 
struct  rmap_item
 

Macros

#define SEQNR_MASK   0x0ff /* low bits of unstable tree seqnr */
 
#define UNSTABLE_FLAG   0x100 /* is a node of the unstable tree */
 
#define STABLE_FLAG   0x200 /* is listed from the stable tree */
 
#define MM_SLOTS_HASH_SHIFT   10
 
#define MM_SLOTS_HASH_HEADS   (1 << MM_SLOTS_HASH_SHIFT)
 
#define KSM_RUN_STOP   0
 
#define KSM_RUN_MERGE   1
 
#define KSM_RUN_UNMERGE   2
 
#define KSM_KMEM_CACHE(__struct, __flags)
 

Functions

int ksm_madvise (struct vm_area_struct *vma, unsigned long start, unsigned long end, int advice, unsigned long *vm_flags)
 
int __ksm_enter (struct mm_struct *mm)
 
void __ksm_exit (struct mm_struct *mm)
 
struct pageksm_does_need_to_copy (struct page *page, struct vm_area_struct *vma, unsigned long address)
 
int page_referenced_ksm (struct page *page, struct mem_cgroup *memcg, unsigned long *vm_flags)
 
int try_to_unmap_ksm (struct page *page, enum ttu_flags flags)
 

Macro Definition Documentation

#define KSM_KMEM_CACHE (   __struct,
  __flags 
)
Value:
kmem_cache_create("ksm_"#__struct,\
sizeof(struct __struct), __alignof__(struct __struct),\
(__flags), NULL)

Definition at line 201 of file ksm.c.

#define KSM_RUN_MERGE   1

Definition at line 193 of file ksm.c.

#define KSM_RUN_STOP   0

Definition at line 192 of file ksm.c.

#define KSM_RUN_UNMERGE   2

Definition at line 194 of file ksm.c.

#define MM_SLOTS_HASH_HEADS   (1 << MM_SLOTS_HASH_SHIFT)

Definition at line 160 of file ksm.c.

#define MM_SLOTS_HASH_SHIFT   10

Definition at line 159 of file ksm.c.

#define SEQNR_MASK   0x0ff /* low bits of unstable tree seqnr */

Definition at line 151 of file ksm.c.

#define STABLE_FLAG   0x200 /* is listed from the stable tree */

Definition at line 153 of file ksm.c.

#define UNSTABLE_FLAG   0x100 /* is a node of the unstable tree */

Definition at line 152 of file ksm.c.

Function Documentation

int __ksm_enter ( struct mm_struct mm)

Definition at line 1523 of file ksm.c.

void __ksm_exit ( struct mm_struct mm)

Definition at line 1554 of file ksm.c.

struct page* ksm_does_need_to_copy ( struct page page,
struct vm_area_struct vma,
unsigned long  address 
)
read

Definition at line 1592 of file ksm.c.

int ksm_madvise ( struct vm_area_struct vma,
unsigned long  start,
unsigned long  end,
int  advice,
unsigned long vm_flags 
)

Definition at line 1476 of file ksm.c.

int page_referenced_ksm ( struct page page,
struct mem_cgroup memcg,
unsigned long vm_flags 
)

Definition at line 1615 of file ksm.c.

int try_to_unmap_ksm ( struct page page,
enum ttu_flags  flags 
)

Definition at line 1671 of file ksm.c.