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
  10/*
  11 * struct page extension
  12 *
  13 * This is the feature to manage memory for extended data per page.
  14 */
  15
  16static struct page_ext_operations *page_ext_ops[] = {
  17        &debug_guardpage_ops,
  18#ifdef CONFIG_PAGE_POISONING
  19        &page_poisoning_ops,
  20#endif
  21};
  22
  23void __init invoke_page_ext_init_callbacks(void)
  24{
  25        int i;
  26        int entries = ARRAY_SIZE(page_ext_ops);
  27
  28        for (i = 0; i < entries; i++) {
  29                if (page_ext_ops[i]->init)
  30                        page_ext_ops[i]->init();
  31        }
  32}
  33
  34struct page_ext *lookup_page_ext(struct page *page)
  35{
  36        struct page_cgroup *pc = lookup_page_cgroup(page);
  37
  38        return &pc->ext;
  39}
  40