mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-26 06:33:19 -04:00
Merge branch 'akpm' (patches from Andrew)
Merge first patch-bomb from Andrew Morton: - some misc things - ofs2 updates - about half of MM - checkpatch updates - autofs4 update * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (120 commits) autofs4: fix string.h include in auto_dev-ioctl.h autofs4: use pr_xxx() macros directly for logging autofs4: change log print macros to not insert newline autofs4: make autofs log prints consistent autofs4: fix some white space errors autofs4: fix invalid ioctl return in autofs4_root_ioctl_unlocked() autofs4: fix coding style line length in autofs4_wait() autofs4: fix coding style problem in autofs4_get_set_timeout() autofs4: coding style fixes autofs: show pipe inode in mount options kallsyms: add support for relative offsets in kallsyms address table kallsyms: don't overload absolute symbol type for percpu symbols x86: kallsyms: disable absolute percpu symbols on !SMP checkpatch: fix another left brace warning checkpatch: improve UNSPECIFIED_INT test for bare signed/unsigned uses checkpatch: warn on bare unsigned or signed declarations without int checkpatch: exclude asm volatile from complex macro check mm: memcontrol: drop unnecessary lru locking from mem_cgroup_migrate() mm: migrate: consolidate mem_cgroup_migrate() calls mm/compaction: speed up pageblock_pfn_to_page() when zone is contiguous ...
This commit is contained in:
commit
271ecc5253
119 changed files with 3139 additions and 1805 deletions
|
|
@ -11,12 +11,7 @@
|
|||
#define _LINUX_AUTO_DEV_IOCTL_H
|
||||
|
||||
#include <linux/auto_fs.h>
|
||||
|
||||
#ifdef __KERNEL__
|
||||
#include <linux/string.h>
|
||||
#else
|
||||
#include <string.h>
|
||||
#endif /* __KERNEL__ */
|
||||
|
||||
#define AUTOFS_DEVICE_NAME "autofs"
|
||||
|
||||
|
|
@ -125,7 +120,6 @@ static inline void init_autofs_dev_ioctl(struct autofs_dev_ioctl *in)
|
|||
in->ver_minor = AUTOFS_DEV_IOCTL_VERSION_MINOR;
|
||||
in->size = sizeof(struct autofs_dev_ioctl);
|
||||
in->ioctlfd = -1;
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -1,14 +1,10 @@
|
|||
/* -*- linux-c -*- ------------------------------------------------------- *
|
||||
*
|
||||
* linux/include/linux/auto_fs.h
|
||||
*
|
||||
* Copyright 1997 Transmeta Corporation - All Rights Reserved
|
||||
/*
|
||||
* Copyright 1997 Transmeta Corporation - All Rights Reserved
|
||||
*
|
||||
* This file is part of the Linux kernel and is made available under
|
||||
* the terms of the GNU General Public License, version 2, or at your
|
||||
* option, any later version, incorporated herein by reference.
|
||||
*
|
||||
* ----------------------------------------------------------------------- */
|
||||
*/
|
||||
|
||||
#ifndef _LINUX_AUTO_FS_H
|
||||
#define _LINUX_AUTO_FS_H
|
||||
|
|
|
|||
|
|
@ -62,10 +62,9 @@ static inline struct dentry *fault_create_debugfs_attr(const char *name,
|
|||
#endif /* CONFIG_FAULT_INJECTION */
|
||||
|
||||
#ifdef CONFIG_FAILSLAB
|
||||
extern bool should_failslab(size_t size, gfp_t gfpflags, unsigned long flags);
|
||||
extern bool should_failslab(struct kmem_cache *s, gfp_t gfpflags);
|
||||
#else
|
||||
static inline bool should_failslab(size_t size, gfp_t gfpflags,
|
||||
unsigned long flags)
|
||||
static inline bool should_failslab(struct kmem_cache *s, gfp_t gfpflags)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,11 @@
|
|||
|
||||
struct vm_area_struct;
|
||||
|
||||
/*
|
||||
* In case of changes, please don't forget to update
|
||||
* include/trace/events/mmflags.h and tools/perf/builtin-kmem.c
|
||||
*/
|
||||
|
||||
/* Plain integer GFP bitmasks. Do not use this directly. */
|
||||
#define ___GFP_DMA 0x01u
|
||||
#define ___GFP_HIGHMEM 0x02u
|
||||
|
|
@ -48,7 +53,6 @@ struct vm_area_struct;
|
|||
#define __GFP_DMA ((__force gfp_t)___GFP_DMA)
|
||||
#define __GFP_HIGHMEM ((__force gfp_t)___GFP_HIGHMEM)
|
||||
#define __GFP_DMA32 ((__force gfp_t)___GFP_DMA32)
|
||||
#define __GFP_MOVABLE ((__force gfp_t)___GFP_MOVABLE) /* Page is movable */
|
||||
#define __GFP_MOVABLE ((__force gfp_t)___GFP_MOVABLE) /* ZONE_MOVABLE allowed */
|
||||
#define GFP_ZONEMASK (__GFP_DMA|__GFP_HIGHMEM|__GFP_DMA32|__GFP_MOVABLE)
|
||||
|
||||
|
|
@ -515,13 +519,7 @@ void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp);
|
|||
void drain_all_pages(struct zone *zone);
|
||||
void drain_local_pages(struct zone *zone);
|
||||
|
||||
#ifdef CONFIG_DEFERRED_STRUCT_PAGE_INIT
|
||||
void page_alloc_init_late(void);
|
||||
#else
|
||||
static inline void page_alloc_init_late(void)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* gfp_allowed_mask is set to GFP_BOOT_MASK during early boot to restrict what
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
#include <linux/eventfd.h>
|
||||
#include <linux/mmzone.h>
|
||||
#include <linux/writeback.h>
|
||||
#include <linux/page-flags.h>
|
||||
|
||||
struct mem_cgroup;
|
||||
struct page;
|
||||
|
|
@ -89,6 +90,10 @@ enum mem_cgroup_events_target {
|
|||
};
|
||||
|
||||
#ifdef CONFIG_MEMCG
|
||||
|
||||
#define MEM_CGROUP_ID_SHIFT 16
|
||||
#define MEM_CGROUP_ID_MAX USHRT_MAX
|
||||
|
||||
struct mem_cgroup_stat_cpu {
|
||||
long count[MEMCG_NR_STAT];
|
||||
unsigned long events[MEMCG_NR_EVENTS];
|
||||
|
|
@ -265,6 +270,11 @@ struct mem_cgroup {
|
|||
|
||||
extern struct mem_cgroup *root_mem_cgroup;
|
||||
|
||||
static inline bool mem_cgroup_disabled(void)
|
||||
{
|
||||
return !cgroup_subsys_enabled(memory_cgrp_subsys);
|
||||
}
|
||||
|
||||
/**
|
||||
* mem_cgroup_events - count memory events against a cgroup
|
||||
* @memcg: the memory cgroup
|
||||
|
|
@ -291,7 +301,7 @@ void mem_cgroup_cancel_charge(struct page *page, struct mem_cgroup *memcg,
|
|||
void mem_cgroup_uncharge(struct page *page);
|
||||
void mem_cgroup_uncharge_list(struct list_head *page_list);
|
||||
|
||||
void mem_cgroup_replace_page(struct page *oldpage, struct page *newpage);
|
||||
void mem_cgroup_migrate(struct page *oldpage, struct page *newpage);
|
||||
|
||||
struct lruvec *mem_cgroup_zone_lruvec(struct zone *, struct mem_cgroup *);
|
||||
struct lruvec *mem_cgroup_page_lruvec(struct page *, struct zone *);
|
||||
|
|
@ -312,6 +322,28 @@ struct mem_cgroup *mem_cgroup_iter(struct mem_cgroup *,
|
|||
struct mem_cgroup_reclaim_cookie *);
|
||||
void mem_cgroup_iter_break(struct mem_cgroup *, struct mem_cgroup *);
|
||||
|
||||
static inline unsigned short mem_cgroup_id(struct mem_cgroup *memcg)
|
||||
{
|
||||
if (mem_cgroup_disabled())
|
||||
return 0;
|
||||
|
||||
return memcg->css.id;
|
||||
}
|
||||
|
||||
/**
|
||||
* mem_cgroup_from_id - look up a memcg from an id
|
||||
* @id: the id to look up
|
||||
*
|
||||
* Caller must hold rcu_read_lock() and use css_tryget() as necessary.
|
||||
*/
|
||||
static inline struct mem_cgroup *mem_cgroup_from_id(unsigned short id)
|
||||
{
|
||||
struct cgroup_subsys_state *css;
|
||||
|
||||
css = css_from_id(id, &memory_cgrp_subsys);
|
||||
return mem_cgroup_from_css(css);
|
||||
}
|
||||
|
||||
/**
|
||||
* parent_mem_cgroup - find the accounting parent of a memcg
|
||||
* @memcg: memcg whose parent to find
|
||||
|
|
@ -353,11 +385,6 @@ static inline bool mm_match_cgroup(struct mm_struct *mm,
|
|||
struct cgroup_subsys_state *mem_cgroup_css_from_page(struct page *page);
|
||||
ino_t page_cgroup_ino(struct page *page);
|
||||
|
||||
static inline bool mem_cgroup_disabled(void)
|
||||
{
|
||||
return !cgroup_subsys_enabled(memory_cgrp_subsys);
|
||||
}
|
||||
|
||||
static inline bool mem_cgroup_online(struct mem_cgroup *memcg)
|
||||
{
|
||||
if (mem_cgroup_disabled())
|
||||
|
|
@ -429,36 +456,43 @@ bool mem_cgroup_oom_synchronize(bool wait);
|
|||
extern int do_swap_account;
|
||||
#endif
|
||||
|
||||
struct mem_cgroup *mem_cgroup_begin_page_stat(struct page *page);
|
||||
void mem_cgroup_end_page_stat(struct mem_cgroup *memcg);
|
||||
void lock_page_memcg(struct page *page);
|
||||
void unlock_page_memcg(struct page *page);
|
||||
|
||||
/**
|
||||
* mem_cgroup_update_page_stat - update page state statistics
|
||||
* @memcg: memcg to account against
|
||||
* @page: the page
|
||||
* @idx: page state item to account
|
||||
* @val: number of pages (positive or negative)
|
||||
*
|
||||
* See mem_cgroup_begin_page_stat() for locking requirements.
|
||||
* The @page must be locked or the caller must use lock_page_memcg()
|
||||
* to prevent double accounting when the page is concurrently being
|
||||
* moved to another memcg:
|
||||
*
|
||||
* lock_page(page) or lock_page_memcg(page)
|
||||
* if (TestClearPageState(page))
|
||||
* mem_cgroup_update_page_stat(page, state, -1);
|
||||
* unlock_page(page) or unlock_page_memcg(page)
|
||||
*/
|
||||
static inline void mem_cgroup_update_page_stat(struct mem_cgroup *memcg,
|
||||
static inline void mem_cgroup_update_page_stat(struct page *page,
|
||||
enum mem_cgroup_stat_index idx, int val)
|
||||
{
|
||||
VM_BUG_ON(!rcu_read_lock_held());
|
||||
VM_BUG_ON(!(rcu_read_lock_held() || PageLocked(page)));
|
||||
|
||||
if (memcg)
|
||||
this_cpu_add(memcg->stat->count[idx], val);
|
||||
if (page->mem_cgroup)
|
||||
this_cpu_add(page->mem_cgroup->stat->count[idx], val);
|
||||
}
|
||||
|
||||
static inline void mem_cgroup_inc_page_stat(struct mem_cgroup *memcg,
|
||||
static inline void mem_cgroup_inc_page_stat(struct page *page,
|
||||
enum mem_cgroup_stat_index idx)
|
||||
{
|
||||
mem_cgroup_update_page_stat(memcg, idx, 1);
|
||||
mem_cgroup_update_page_stat(page, idx, 1);
|
||||
}
|
||||
|
||||
static inline void mem_cgroup_dec_page_stat(struct mem_cgroup *memcg,
|
||||
static inline void mem_cgroup_dec_page_stat(struct page *page,
|
||||
enum mem_cgroup_stat_index idx)
|
||||
{
|
||||
mem_cgroup_update_page_stat(memcg, idx, -1);
|
||||
mem_cgroup_update_page_stat(page, idx, -1);
|
||||
}
|
||||
|
||||
unsigned long mem_cgroup_soft_limit_reclaim(struct zone *zone, int order,
|
||||
|
|
@ -496,8 +530,17 @@ void mem_cgroup_split_huge_fixup(struct page *head);
|
|||
#endif
|
||||
|
||||
#else /* CONFIG_MEMCG */
|
||||
|
||||
#define MEM_CGROUP_ID_SHIFT 0
|
||||
#define MEM_CGROUP_ID_MAX 0
|
||||
|
||||
struct mem_cgroup;
|
||||
|
||||
static inline bool mem_cgroup_disabled(void)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
static inline void mem_cgroup_events(struct mem_cgroup *memcg,
|
||||
enum mem_cgroup_events_index idx,
|
||||
unsigned int nr)
|
||||
|
|
@ -539,7 +582,7 @@ static inline void mem_cgroup_uncharge_list(struct list_head *page_list)
|
|||
{
|
||||
}
|
||||
|
||||
static inline void mem_cgroup_replace_page(struct page *old, struct page *new)
|
||||
static inline void mem_cgroup_migrate(struct page *old, struct page *new)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -580,9 +623,16 @@ static inline void mem_cgroup_iter_break(struct mem_cgroup *root,
|
|||
{
|
||||
}
|
||||
|
||||
static inline bool mem_cgroup_disabled(void)
|
||||
static inline unsigned short mem_cgroup_id(struct mem_cgroup *memcg)
|
||||
{
|
||||
return true;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline struct mem_cgroup *mem_cgroup_from_id(unsigned short id)
|
||||
{
|
||||
WARN_ON_ONCE(id);
|
||||
/* XXX: This should always return root_mem_cgroup */
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline bool mem_cgroup_online(struct mem_cgroup *memcg)
|
||||
|
|
@ -613,12 +663,11 @@ mem_cgroup_print_oom_info(struct mem_cgroup *memcg, struct task_struct *p)
|
|||
{
|
||||
}
|
||||
|
||||
static inline struct mem_cgroup *mem_cgroup_begin_page_stat(struct page *page)
|
||||
static inline void lock_page_memcg(struct page *page)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline void mem_cgroup_end_page_stat(struct mem_cgroup *memcg)
|
||||
static inline void unlock_page_memcg(struct page *page)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -644,12 +693,12 @@ static inline bool mem_cgroup_oom_synchronize(bool wait)
|
|||
return false;
|
||||
}
|
||||
|
||||
static inline void mem_cgroup_inc_page_stat(struct mem_cgroup *memcg,
|
||||
static inline void mem_cgroup_inc_page_stat(struct page *page,
|
||||
enum mem_cgroup_stat_index idx)
|
||||
{
|
||||
}
|
||||
|
||||
static inline void mem_cgroup_dec_page_stat(struct mem_cgroup *memcg,
|
||||
static inline void mem_cgroup_dec_page_stat(struct page *page,
|
||||
enum mem_cgroup_stat_index idx)
|
||||
{
|
||||
}
|
||||
|
|
@ -765,7 +814,7 @@ int __memcg_kmem_charge(struct page *page, gfp_t gfp, int order);
|
|||
void __memcg_kmem_uncharge(struct page *page, int order);
|
||||
|
||||
/*
|
||||
* helper for acessing a memcg's index. It will be used as an index in the
|
||||
* helper for accessing a memcg's index. It will be used as an index in the
|
||||
* child cache array in kmem_cache, and also to derive its name. This function
|
||||
* will return -1 when this is not a kmem-limited memcg.
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -109,6 +109,9 @@ extern void unregister_memory_notifier(struct notifier_block *nb);
|
|||
extern int register_memory_isolate_notifier(struct notifier_block *nb);
|
||||
extern void unregister_memory_isolate_notifier(struct notifier_block *nb);
|
||||
extern int register_new_memory(int, struct mem_section *);
|
||||
extern int memory_block_change_state(struct memory_block *mem,
|
||||
unsigned long to_state,
|
||||
unsigned long from_state_req);
|
||||
#ifdef CONFIG_MEMORY_HOTREMOVE
|
||||
extern int unregister_memory_section(struct mem_section *);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -99,6 +99,8 @@ extern void __online_page_free(struct page *page);
|
|||
|
||||
extern int try_online_node(int nid);
|
||||
|
||||
extern bool memhp_auto_online;
|
||||
|
||||
#ifdef CONFIG_MEMORY_HOTREMOVE
|
||||
extern bool is_pageblock_removable_nolock(struct page *page);
|
||||
extern int arch_remove_memory(u64 start, u64 size);
|
||||
|
|
@ -196,6 +198,9 @@ void put_online_mems(void);
|
|||
void mem_hotplug_begin(void);
|
||||
void mem_hotplug_done(void);
|
||||
|
||||
extern void set_zone_contiguous(struct zone *zone);
|
||||
extern void clear_zone_contiguous(struct zone *zone);
|
||||
|
||||
#else /* ! CONFIG_MEMORY_HOTPLUG */
|
||||
/*
|
||||
* Stub functions for when hotplug is off
|
||||
|
|
@ -267,7 +272,7 @@ static inline void remove_memory(int nid, u64 start, u64 size) {}
|
|||
extern int walk_memory_range(unsigned long start_pfn, unsigned long end_pfn,
|
||||
void *arg, int (*func)(struct memory_block *, void *));
|
||||
extern int add_memory(int nid, u64 start, u64 size);
|
||||
extern int add_memory_resource(int nid, struct resource *resource);
|
||||
extern int add_memory_resource(int nid, struct resource *resource, bool online);
|
||||
extern int zone_for_memory(int nid, u64 start, u64 size, int zone_default,
|
||||
bool for_device);
|
||||
extern int arch_add_memory(int nid, u64 start, u64 size, bool for_device);
|
||||
|
|
|
|||
|
|
@ -23,9 +23,13 @@ enum migrate_reason {
|
|||
MR_SYSCALL, /* also applies to cpusets */
|
||||
MR_MEMPOLICY_MBIND,
|
||||
MR_NUMA_MISPLACED,
|
||||
MR_CMA
|
||||
MR_CMA,
|
||||
MR_TYPES
|
||||
};
|
||||
|
||||
/* In mm/debug.c; also keep sync with include/trace/events/migrate.h */
|
||||
extern char *migrate_reason_names[MR_TYPES];
|
||||
|
||||
#ifdef CONFIG_MIGRATION
|
||||
|
||||
extern void putback_movable_pages(struct list_head *l);
|
||||
|
|
|
|||
|
|
@ -905,20 +905,11 @@ static inline struct mem_cgroup *page_memcg(struct page *page)
|
|||
{
|
||||
return page->mem_cgroup;
|
||||
}
|
||||
|
||||
static inline void set_page_memcg(struct page *page, struct mem_cgroup *memcg)
|
||||
{
|
||||
page->mem_cgroup = memcg;
|
||||
}
|
||||
#else
|
||||
static inline struct mem_cgroup *page_memcg(struct page *page)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline void set_page_memcg(struct page *page, struct mem_cgroup *memcg)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
|
|
@ -1300,10 +1291,9 @@ int __set_page_dirty_nobuffers(struct page *page);
|
|||
int __set_page_dirty_no_writeback(struct page *page);
|
||||
int redirty_page_for_writepage(struct writeback_control *wbc,
|
||||
struct page *page);
|
||||
void account_page_dirtied(struct page *page, struct address_space *mapping,
|
||||
struct mem_cgroup *memcg);
|
||||
void account_page_dirtied(struct page *page, struct address_space *mapping);
|
||||
void account_page_cleaned(struct page *page, struct address_space *mapping,
|
||||
struct mem_cgroup *memcg, struct bdi_writeback *wb);
|
||||
struct bdi_writeback *wb);
|
||||
int set_page_dirty(struct page *page);
|
||||
int set_page_dirty_lock(struct page *page);
|
||||
void cancel_dirty_page(struct page *page);
|
||||
|
|
@ -2178,6 +2168,17 @@ extern int apply_to_page_range(struct mm_struct *mm, unsigned long address,
|
|||
unsigned long size, pte_fn_t fn, void *data);
|
||||
|
||||
|
||||
#ifdef CONFIG_PAGE_POISONING
|
||||
extern bool page_poisoning_enabled(void);
|
||||
extern void kernel_poison_pages(struct page *page, int numpages, int enable);
|
||||
extern bool page_is_poisoned(struct page *page);
|
||||
#else
|
||||
static inline bool page_poisoning_enabled(void) { return false; }
|
||||
static inline void kernel_poison_pages(struct page *page, int numpages,
|
||||
int enable) { }
|
||||
static inline bool page_is_poisoned(struct page *page) { return false; }
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_DEBUG_PAGEALLOC
|
||||
extern bool _debug_pagealloc_enabled;
|
||||
extern void __kernel_map_pages(struct page *page, int numpages, int enable);
|
||||
|
|
@ -2197,14 +2198,18 @@ kernel_map_pages(struct page *page, int numpages, int enable)
|
|||
}
|
||||
#ifdef CONFIG_HIBERNATION
|
||||
extern bool kernel_page_present(struct page *page);
|
||||
#endif /* CONFIG_HIBERNATION */
|
||||
#else
|
||||
#endif /* CONFIG_HIBERNATION */
|
||||
#else /* CONFIG_DEBUG_PAGEALLOC */
|
||||
static inline void
|
||||
kernel_map_pages(struct page *page, int numpages, int enable) {}
|
||||
#ifdef CONFIG_HIBERNATION
|
||||
static inline bool kernel_page_present(struct page *page) { return true; }
|
||||
#endif /* CONFIG_HIBERNATION */
|
||||
#endif
|
||||
#endif /* CONFIG_HIBERNATION */
|
||||
static inline bool debug_pagealloc_enabled(void)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
#endif /* CONFIG_DEBUG_PAGEALLOC */
|
||||
|
||||
#ifdef __HAVE_ARCH_GATE_AREA
|
||||
extern struct vm_area_struct *get_gate_vma(struct mm_struct *mm);
|
||||
|
|
|
|||
|
|
@ -9,8 +9,7 @@ struct vm_area_struct;
|
|||
struct mm_struct;
|
||||
|
||||
extern void dump_page(struct page *page, const char *reason);
|
||||
extern void dump_page_badflags(struct page *page, const char *reason,
|
||||
unsigned long badflags);
|
||||
extern void __dump_page(struct page *page, const char *reason);
|
||||
void dump_vma(const struct vm_area_struct *vma);
|
||||
void dump_mm(const struct mm_struct *mm);
|
||||
|
||||
|
|
|
|||
|
|
@ -63,6 +63,9 @@ enum {
|
|||
MIGRATE_TYPES
|
||||
};
|
||||
|
||||
/* In mm/page_alloc.c; keep in sync also with show_migration_types() there */
|
||||
extern char * const migratetype_names[MIGRATE_TYPES];
|
||||
|
||||
#ifdef CONFIG_CMA
|
||||
# define is_migrate_cma(migratetype) unlikely((migratetype) == MIGRATE_CMA)
|
||||
#else
|
||||
|
|
@ -209,10 +212,12 @@ struct zone_reclaim_stat {
|
|||
};
|
||||
|
||||
struct lruvec {
|
||||
struct list_head lists[NR_LRU_LISTS];
|
||||
struct zone_reclaim_stat reclaim_stat;
|
||||
struct list_head lists[NR_LRU_LISTS];
|
||||
struct zone_reclaim_stat reclaim_stat;
|
||||
/* Evictions & activations on the inactive file list */
|
||||
atomic_long_t inactive_age;
|
||||
#ifdef CONFIG_MEMCG
|
||||
struct zone *zone;
|
||||
struct zone *zone;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
|
@ -487,9 +492,6 @@ struct zone {
|
|||
spinlock_t lru_lock;
|
||||
struct lruvec lruvec;
|
||||
|
||||
/* Evictions & activations on the inactive file list */
|
||||
atomic_long_t inactive_age;
|
||||
|
||||
/*
|
||||
* When free pages are below this point, additional steps are taken
|
||||
* when reading the number of free pages to avoid per-cpu counter
|
||||
|
|
@ -520,6 +522,8 @@ struct zone {
|
|||
bool compact_blockskip_flush;
|
||||
#endif
|
||||
|
||||
bool contiguous;
|
||||
|
||||
ZONE_PADDING(_pad3_)
|
||||
/* Zone statistics */
|
||||
atomic_long_t vm_stat[NR_VM_ZONE_STAT_ITEMS];
|
||||
|
|
@ -758,6 +762,8 @@ static inline struct zone *lruvec_zone(struct lruvec *lruvec)
|
|||
#endif
|
||||
}
|
||||
|
||||
extern unsigned long lruvec_lru_size(struct lruvec *lruvec, enum lru_list lru);
|
||||
|
||||
#ifdef CONFIG_HAVE_MEMORY_PRESENT
|
||||
void memory_present(int nid, unsigned long start, unsigned long end);
|
||||
#else
|
||||
|
|
|
|||
|
|
@ -45,6 +45,7 @@ struct page_ext {
|
|||
unsigned int order;
|
||||
gfp_t gfp_mask;
|
||||
unsigned int nr_entries;
|
||||
int last_migrate_reason;
|
||||
unsigned long trace_entries[8];
|
||||
#endif
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,38 +1,54 @@
|
|||
#ifndef __LINUX_PAGE_OWNER_H
|
||||
#define __LINUX_PAGE_OWNER_H
|
||||
|
||||
#include <linux/jump_label.h>
|
||||
|
||||
#ifdef CONFIG_PAGE_OWNER
|
||||
extern bool page_owner_inited;
|
||||
extern struct static_key_false page_owner_inited;
|
||||
extern struct page_ext_operations page_owner_ops;
|
||||
|
||||
extern void __reset_page_owner(struct page *page, unsigned int order);
|
||||
extern void __set_page_owner(struct page *page,
|
||||
unsigned int order, gfp_t gfp_mask);
|
||||
extern gfp_t __get_page_owner_gfp(struct page *page);
|
||||
extern void __copy_page_owner(struct page *oldpage, struct page *newpage);
|
||||
extern void __set_page_owner_migrate_reason(struct page *page, int reason);
|
||||
extern void __dump_page_owner(struct page *page);
|
||||
|
||||
static inline void reset_page_owner(struct page *page, unsigned int order)
|
||||
{
|
||||
if (likely(!page_owner_inited))
|
||||
return;
|
||||
|
||||
__reset_page_owner(page, order);
|
||||
if (static_branch_unlikely(&page_owner_inited))
|
||||
__reset_page_owner(page, order);
|
||||
}
|
||||
|
||||
static inline void set_page_owner(struct page *page,
|
||||
unsigned int order, gfp_t gfp_mask)
|
||||
{
|
||||
if (likely(!page_owner_inited))
|
||||
return;
|
||||
|
||||
__set_page_owner(page, order, gfp_mask);
|
||||
if (static_branch_unlikely(&page_owner_inited))
|
||||
__set_page_owner(page, order, gfp_mask);
|
||||
}
|
||||
|
||||
static inline gfp_t get_page_owner_gfp(struct page *page)
|
||||
{
|
||||
if (likely(!page_owner_inited))
|
||||
if (static_branch_unlikely(&page_owner_inited))
|
||||
return __get_page_owner_gfp(page);
|
||||
else
|
||||
return 0;
|
||||
|
||||
return __get_page_owner_gfp(page);
|
||||
}
|
||||
static inline void copy_page_owner(struct page *oldpage, struct page *newpage)
|
||||
{
|
||||
if (static_branch_unlikely(&page_owner_inited))
|
||||
__copy_page_owner(oldpage, newpage);
|
||||
}
|
||||
static inline void set_page_owner_migrate_reason(struct page *page, int reason)
|
||||
{
|
||||
if (static_branch_unlikely(&page_owner_inited))
|
||||
__set_page_owner_migrate_reason(page, reason);
|
||||
}
|
||||
static inline void dump_page_owner(struct page *page)
|
||||
{
|
||||
if (static_branch_unlikely(&page_owner_inited))
|
||||
__dump_page_owner(page);
|
||||
}
|
||||
#else
|
||||
static inline void reset_page_owner(struct page *page, unsigned int order)
|
||||
|
|
@ -46,6 +62,14 @@ static inline gfp_t get_page_owner_gfp(struct page *page)
|
|||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline void copy_page_owner(struct page *oldpage, struct page *newpage)
|
||||
{
|
||||
}
|
||||
static inline void set_page_owner_migrate_reason(struct page *page, int reason)
|
||||
{
|
||||
}
|
||||
static inline void dump_page_owner(struct page *page)
|
||||
{
|
||||
}
|
||||
#endif /* CONFIG_PAGE_OWNER */
|
||||
#endif /* __LINUX_PAGE_OWNER_H */
|
||||
|
|
|
|||
|
|
@ -663,8 +663,7 @@ int add_to_page_cache_locked(struct page *page, struct address_space *mapping,
|
|||
int add_to_page_cache_lru(struct page *page, struct address_space *mapping,
|
||||
pgoff_t index, gfp_t gfp_mask);
|
||||
extern void delete_from_page_cache(struct page *page);
|
||||
extern void __delete_from_page_cache(struct page *page, void *shadow,
|
||||
struct mem_cgroup *memcg);
|
||||
extern void __delete_from_page_cache(struct page *page, void *shadow);
|
||||
int replace_page_cache_page(struct page *old, struct page *new, gfp_t gfp_mask);
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -30,7 +30,11 @@
|
|||
#define TIMER_ENTRY_STATIC ((void *) 0x300 + POISON_POINTER_DELTA)
|
||||
|
||||
/********** mm/debug-pagealloc.c **********/
|
||||
#ifdef CONFIG_PAGE_POISONING_ZERO
|
||||
#define PAGE_POISON 0x00
|
||||
#else
|
||||
#define PAGE_POISON 0xaa
|
||||
#endif
|
||||
|
||||
/********** mm/page_alloc.c ************/
|
||||
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
* Flags to pass to kmem_cache_create().
|
||||
* The ones marked DEBUG are only valid if CONFIG_DEBUG_SLAB is set.
|
||||
*/
|
||||
#define SLAB_DEBUG_FREE 0x00000100UL /* DEBUG: Perform (expensive) checks on free */
|
||||
#define SLAB_CONSISTENCY_CHECKS 0x00000100UL /* DEBUG: Perform (expensive) checks on alloc/free */
|
||||
#define SLAB_RED_ZONE 0x00000400UL /* DEBUG: Red zone objs in a cache */
|
||||
#define SLAB_POISON 0x00000800UL /* DEBUG: Poison objects */
|
||||
#define SLAB_HWCACHE_ALIGN 0x00002000UL /* Align objs on cache lines */
|
||||
|
|
@ -314,7 +314,7 @@ void *kmem_cache_alloc(struct kmem_cache *, gfp_t flags) __assume_slab_alignment
|
|||
void kmem_cache_free(struct kmem_cache *, void *);
|
||||
|
||||
/*
|
||||
* Bulk allocation and freeing operations. These are accellerated in an
|
||||
* Bulk allocation and freeing operations. These are accelerated in an
|
||||
* allocator specific way to avoid taking locks repeatedly or building
|
||||
* metadata structures unnecessarily.
|
||||
*
|
||||
|
|
@ -323,6 +323,15 @@ void kmem_cache_free(struct kmem_cache *, void *);
|
|||
void kmem_cache_free_bulk(struct kmem_cache *, size_t, void **);
|
||||
int kmem_cache_alloc_bulk(struct kmem_cache *, gfp_t, size_t, void **);
|
||||
|
||||
/*
|
||||
* Caller must not use kfree_bulk() on memory not originally allocated
|
||||
* by kmalloc(), because the SLOB allocator cannot handle this.
|
||||
*/
|
||||
static __always_inline void kfree_bulk(size_t size, void **p)
|
||||
{
|
||||
kmem_cache_free_bulk(NULL, size, p);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_NUMA
|
||||
void *__kmalloc_node(size_t size, gfp_t flags, int node) __assume_kmalloc_alignment;
|
||||
void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node) __assume_slab_alignment;
|
||||
|
|
|
|||
|
|
@ -60,6 +60,9 @@ struct kmem_cache {
|
|||
atomic_t allocmiss;
|
||||
atomic_t freehit;
|
||||
atomic_t freemiss;
|
||||
#ifdef CONFIG_DEBUG_SLAB_LEAK
|
||||
atomic_t store_user_clean;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* If debugging is enabled, then the allocator can add additional
|
||||
|
|
|
|||
|
|
@ -81,6 +81,7 @@ struct kmem_cache {
|
|||
int reserved; /* Reserved bytes at the end of slabs */
|
||||
const char *name; /* Name (only for display!) */
|
||||
struct list_head list; /* List of slab caches */
|
||||
int red_left_pad; /* Left redzone padding size */
|
||||
#ifdef CONFIG_SYSFS
|
||||
struct kobject kobj; /* For sysfs */
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -15,16 +15,6 @@ struct tracer;
|
|||
struct dentry;
|
||||
struct bpf_prog;
|
||||
|
||||
struct trace_print_flags {
|
||||
unsigned long mask;
|
||||
const char *name;
|
||||
};
|
||||
|
||||
struct trace_print_flags_u64 {
|
||||
unsigned long long mask;
|
||||
const char *name;
|
||||
};
|
||||
|
||||
const char *trace_print_flags_seq(struct trace_seq *p, const char *delim,
|
||||
unsigned long flags,
|
||||
const struct trace_print_flags *flag_array);
|
||||
|
|
|
|||
|
|
@ -3,13 +3,23 @@
|
|||
|
||||
/*
|
||||
* File can be included directly by headers who only want to access
|
||||
* tracepoint->key to guard out of line trace calls. Otherwise
|
||||
* linux/tracepoint.h should be used.
|
||||
* tracepoint->key to guard out of line trace calls, or the definition of
|
||||
* trace_print_flags{_u64}. Otherwise linux/tracepoint.h should be used.
|
||||
*/
|
||||
|
||||
#include <linux/atomic.h>
|
||||
#include <linux/static_key.h>
|
||||
|
||||
struct trace_print_flags {
|
||||
unsigned long mask;
|
||||
const char *name;
|
||||
};
|
||||
|
||||
struct trace_print_flags_u64 {
|
||||
unsigned long long mask;
|
||||
const char *name;
|
||||
};
|
||||
|
||||
struct tracepoint_func {
|
||||
void *func;
|
||||
void *data;
|
||||
|
|
|
|||
Loading…
Reference in a new issue