Blame view

include/linux/page_ext.h 1.85 KB
eefa864b7   Joonsoo Kim   mm/page_ext: resu...
1
2
  #ifndef __LINUX_PAGE_EXT_H
  #define __LINUX_PAGE_EXT_H
48c96a368   Joonsoo Kim   mm/page_owner: ke...
3
4
  #include <linux/types.h>
  #include <linux/stacktrace.h>
f2ca0b557   Joonsoo Kim   mm/page_owner: us...
5
  #include <linux/stackdepot.h>
48c96a368   Joonsoo Kim   mm/page_owner: ke...
6

eefa864b7   Joonsoo Kim   mm/page_ext: resu...
7
8
  struct pglist_data;
  struct page_ext_operations {
980ac1672   Joonsoo Kim   mm/page_ext: supp...
9
10
  	size_t offset;
  	size_t size;
eefa864b7   Joonsoo Kim   mm/page_ext: resu...
11
12
13
14
15
16
17
  	bool (*need)(void);
  	void (*init)(void);
  };
  
  #ifdef CONFIG_PAGE_EXTENSION
  
  /*
e30825f18   Joonsoo Kim   mm/debug-pageallo...
18
19
20
21
22
23
24
25
26
27
28
29
   * page_ext->flags bits:
   *
   * PAGE_EXT_DEBUG_POISON is set for poisoned pages. This is used to
   * implement generic debug pagealloc feature. The pages are filled with
   * poison patterns and set this flag after free_pages(). The poisoned
   * pages are verified whether the patterns are not corrupted and clear
   * the flag before alloc_pages().
   */
  
  enum page_ext_flags {
  	PAGE_EXT_DEBUG_POISON,		/* Page is poisoned */
  	PAGE_EXT_DEBUG_GUARD,
48c96a368   Joonsoo Kim   mm/page_owner: ke...
30
  	PAGE_EXT_OWNER,
33c3fc71c   Vladimir Davydov   mm: introduce idl...
31
32
33
34
  #if defined(CONFIG_IDLE_PAGE_TRACKING) && !defined(CONFIG_64BIT)
  	PAGE_EXT_YOUNG,
  	PAGE_EXT_IDLE,
  #endif
e30825f18   Joonsoo Kim   mm/debug-pageallo...
35
36
37
  };
  
  /*
eefa864b7   Joonsoo Kim   mm/page_ext: resu...
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
   * Page Extension can be considered as an extended mem_map.
   * A page_ext page is associated with every page descriptor. The
   * page_ext helps us add more information about the page.
   * All page_ext are allocated at boot or memory hotplug event,
   * then the page_ext for pfn always exists.
   */
  struct page_ext {
  	unsigned long flags;
  };
  
  extern void pgdat_page_ext_init(struct pglist_data *pgdat);
  
  #ifdef CONFIG_SPARSEMEM
  static inline void page_ext_init_flatmem(void)
  {
  }
  extern void page_ext_init(void);
  #else
  extern void page_ext_init_flatmem(void);
  static inline void page_ext_init(void)
  {
  }
  #endif
  
  struct page_ext *lookup_page_ext(struct page *page);
  
  #else /* !CONFIG_PAGE_EXTENSION */
  struct page_ext;
  
  static inline void pgdat_page_ext_init(struct pglist_data *pgdat)
  {
  }
  
  static inline struct page_ext *lookup_page_ext(struct page *page)
  {
  	return NULL;
  }
  
  static inline void page_ext_init(void)
  {
  }
  
  static inline void page_ext_init_flatmem(void)
  {
  }
  #endif /* CONFIG_PAGE_EXTENSION */
  #endif /* __LINUX_PAGE_EXT_H */