Merge branch 'akpm' (patches from Andrew)
Merge more updates from Andrew Morton: - MM remainders - various misc things - kcov updates * emailed patches from Andrew Morton <akpm@linux-foundation.org>: (27 commits) lib/test_printf.c: call wait_for_random_bytes() before plain %p tests hexagon: drop the unused variable zero_page_mask hexagon: fix printk format warning in setup.c mm: fix oom_kill event handling treewide: use PHYS_ADDR_MAX to avoid type casting ULLONG_MAX mm: use octal not symbolic permissions ipc: use new return type vm_fault_t sysvipc/sem: mitigate semnum index against spectre v1 fault-injection: reorder config entries arm: port KCOV to arm sched/core / kcov: avoid kcov_area during task switch kcov: prefault the kcov_area kcov: ensure irq code sees a valid area kernel/relay.c: change return type to vm_fault_t exofs: avoid VLA in structures coredump: fix spam with zero VMA process fat: use fat_fs_error() instead of BUG_ON() in __fat_get_block() proc: skip branch in /proc/*/* lookup mremap: remove LATENCY_LIMIT from mremap to reduce the number of TLB shootdowns mm/memblock: add missing include <linux/bootmem.h> ...
This commit is contained in:
@@ -22,13 +22,27 @@ enum kcov_mode {
|
||||
KCOV_MODE_TRACE_CMP = 3,
|
||||
};
|
||||
|
||||
#define KCOV_IN_CTXSW (1 << 30)
|
||||
|
||||
void kcov_task_init(struct task_struct *t);
|
||||
void kcov_task_exit(struct task_struct *t);
|
||||
|
||||
#define kcov_prepare_switch(t) \
|
||||
do { \
|
||||
(t)->kcov_mode |= KCOV_IN_CTXSW; \
|
||||
} while (0)
|
||||
|
||||
#define kcov_finish_switch(t) \
|
||||
do { \
|
||||
(t)->kcov_mode &= ~KCOV_IN_CTXSW; \
|
||||
} while (0)
|
||||
|
||||
#else
|
||||
|
||||
static inline void kcov_task_init(struct task_struct *t) {}
|
||||
static inline void kcov_task_exit(struct task_struct *t) {}
|
||||
static inline void kcov_prepare_switch(struct task_struct *t) {}
|
||||
static inline void kcov_finish_switch(struct task_struct *t) {}
|
||||
|
||||
#endif /* CONFIG_KCOV */
|
||||
#endif /* _LINUX_KCOV_H */
|
||||
|
@@ -53,6 +53,7 @@ enum memcg_memory_event {
|
||||
MEMCG_HIGH,
|
||||
MEMCG_MAX,
|
||||
MEMCG_OOM,
|
||||
MEMCG_OOM_KILL,
|
||||
MEMCG_SWAP_MAX,
|
||||
MEMCG_SWAP_FAIL,
|
||||
MEMCG_NR_MEMORY_EVENTS,
|
||||
@@ -720,11 +721,8 @@ static inline void count_memcg_event_mm(struct mm_struct *mm,
|
||||
|
||||
rcu_read_lock();
|
||||
memcg = mem_cgroup_from_task(rcu_dereference(mm->owner));
|
||||
if (likely(memcg)) {
|
||||
if (likely(memcg))
|
||||
count_memcg_events(memcg, idx, 1);
|
||||
if (idx == OOM_KILL)
|
||||
cgroup_file_notify(&memcg->events_file);
|
||||
}
|
||||
rcu_read_unlock();
|
||||
}
|
||||
|
||||
@@ -735,6 +733,21 @@ static inline void memcg_memory_event(struct mem_cgroup *memcg,
|
||||
cgroup_file_notify(&memcg->events_file);
|
||||
}
|
||||
|
||||
static inline void memcg_memory_event_mm(struct mm_struct *mm,
|
||||
enum memcg_memory_event event)
|
||||
{
|
||||
struct mem_cgroup *memcg;
|
||||
|
||||
if (mem_cgroup_disabled())
|
||||
return;
|
||||
|
||||
rcu_read_lock();
|
||||
memcg = mem_cgroup_from_task(rcu_dereference(mm->owner));
|
||||
if (likely(memcg))
|
||||
memcg_memory_event(memcg, event);
|
||||
rcu_read_unlock();
|
||||
}
|
||||
|
||||
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
|
||||
void mem_cgroup_split_huge_fixup(struct page *head);
|
||||
#endif
|
||||
@@ -756,6 +769,11 @@ static inline void memcg_memory_event(struct mem_cgroup *memcg,
|
||||
{
|
||||
}
|
||||
|
||||
static inline void memcg_memory_event_mm(struct mm_struct *mm,
|
||||
enum memcg_memory_event event)
|
||||
{
|
||||
}
|
||||
|
||||
static inline enum mem_cgroup_protection mem_cgroup_protected(
|
||||
struct mem_cgroup *root, struct mem_cgroup *memcg)
|
||||
{
|
||||
|
@@ -1130,7 +1130,7 @@ struct task_struct {
|
||||
|
||||
#ifdef CONFIG_KCOV
|
||||
/* Coverage collection mode enabled for this task (0 if disabled): */
|
||||
enum kcov_mode kcov_mode;
|
||||
unsigned int kcov_mode;
|
||||
|
||||
/* Size of the kcov_area: */
|
||||
unsigned int kcov_size;
|
||||
|
@@ -600,6 +600,7 @@ struct memcg_cache_params {
|
||||
struct memcg_cache_array __rcu *memcg_caches;
|
||||
struct list_head __root_caches_node;
|
||||
struct list_head children;
|
||||
bool dying;
|
||||
};
|
||||
struct {
|
||||
struct mem_cgroup *memcg;
|
||||
|
Reference in New Issue
Block a user