This source file includes following definitions.
- page_cgroup_init_flatmem
- page_cgroup_init
- PageCgroupUsed
- pgdat_page_cgroup_init
- lookup_page_cgroup
- page_cgroup_init
- page_cgroup_init_flatmem
- swap_cgroup_record
- lookup_swap_cgroup_id
- swap_cgroup_swapon
- swap_cgroup_swapoff
#ifndef __LINUX_PAGE_CGROUP_H
#define __LINUX_PAGE_CGROUP_H
enum {
PCG_USED = 0x01,
PCG_MEM = 0x02,
PCG_MEMSW = 0x04,
};
struct pglist_data;
#ifdef CONFIG_MEMCG
struct mem_cgroup;
struct page_cgroup {
unsigned long flags;
struct mem_cgroup *mem_cgroup;
};
extern void pgdat_page_cgroup_init(struct pglist_data *pgdat);
#ifdef CONFIG_SPARSEMEM
static inline void page_cgroup_init_flatmem(void)
{
}
extern void page_cgroup_init(void);
#else
extern void page_cgroup_init_flatmem(void);
static inline void page_cgroup_init(void)
{
}
#endif
struct page_cgroup *lookup_page_cgroup(struct page *page);
static inline int PageCgroupUsed(struct page_cgroup *pc)
{
return !!(pc->flags & PCG_USED);
}
#else
struct page_cgroup;
static inline void pgdat_page_cgroup_init(struct pglist_data *pgdat)
{
}
static inline struct page_cgroup *lookup_page_cgroup(struct page *page)
{
return NULL;
}
static inline void page_cgroup_init(void)
{
}
static inline void page_cgroup_init_flatmem(void)
{
}
#endif
#include <linux/swap.h>
#ifdef CONFIG_MEMCG_SWAP
extern unsigned short swap_cgroup_cmpxchg(swp_entry_t ent,
unsigned short old, unsigned short new);
extern unsigned short swap_cgroup_record(swp_entry_t ent, unsigned short id);
extern unsigned short lookup_swap_cgroup_id(swp_entry_t ent);
extern int swap_cgroup_swapon(int type, unsigned long max_pages);
extern void swap_cgroup_swapoff(int type);
#else
static inline
unsigned short swap_cgroup_record(swp_entry_t ent, unsigned short id)
{
return 0;
}
static inline
unsigned short lookup_swap_cgroup_id(swp_entry_t ent)
{
return 0;
}
static inline int
swap_cgroup_swapon(int type, unsigned long max_pages)
{
return 0;
}
static inline void swap_cgroup_swapoff(int type)
{
return;
}
#endif
#endif