linux/mm/page_ext.c
<<
>>
Prefs
   1#include <linux/mm.h>
   2#include <linux/mmzone.h>
   3#include <linux/bootmem.h>
   4#include <linux/page_ext.h>
   5#include <linux/page_cgroup.h>
   6#include <linux/memory.h>
   7#include <linux/vmalloc.h>
   8#include <linux/kmemleak.h>
   9#include <linux/page_idle.h>
  10
  11/*
  12 * struct page extension
  13 *
  14 * This is the feature to manage memory for extended data per page.
  15 */
  16
  17static struct page_ext_operations *page_ext_ops[] = {
  18        &debug_guardpage_ops,
  19#ifdef CONFIG_PAGE_POISONING
  20        &page_poisoning_ops,
  21#endif
  22#if defined(CONFIG_IDLE_PAGE_TRACKING) && !defined(CONFIG_64BIT)
  23        &page_idle_ops,
  24#endif
  25};
  26
  27void __init invoke_page_ext_init_callbacks(void)
  28{
  29        int i;
  30        int entries = ARRAY_SIZE(page_ext_ops);
  31
  32        for (i = 0; i < entries; i++) {
  33                if (page_ext_ops[i]->init)
  34                        page_ext_ops[i]->init();
  35        }
  36}
  37
  38struct page_ext *lookup_page_ext(struct page *page)
  39{
  40        struct page_cgroup *pc = lookup_page_cgroup(page);
  41
  42        return &pc->ext;
  43}
  44