History

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> ...

Linus Torvalds committed 8 years ago

Commit b5d903c2 parents 7a93251 ee410f156 files · +397 −212Browse files

Showing the changes to include/linux (4 of 56 files). Show all

Unified · Split

4 files
  1. include/linux/kcov.h +14 −0
  2. include/linux/memcontrol.h +22 −4
  3. include/linux/sched.h +1 −1
  4. include/linux/slab.h +1 −0
include/linux/kcov.h+14−0
@@ -22,13 +22,27 @@ enum kcov_mode { · 21 unmodified lines
2222 KCOV_MODE_TRACE_CMP = 3,
2323 };
2424
25+#define KCOV_IN_CTXSW (1 << 30)
26+
2527 void kcov_task_init(struct task_struct *t);
2628 void kcov_task_exit(struct task_struct *t);
2729
30+#define kcov_prepare_switch(t) \
31+do { \
32+ (t)->kcov_mode |= KCOV_IN_CTXSW; \
33+} while (0)
34+
35+#define kcov_finish_switch(t) \
36+do { \
37+ (t)->kcov_mode &= ~KCOV_IN_CTXSW; \
38+} while (0)
39+
2840 #else
2941
3042 static inline void kcov_task_init(struct task_struct *t) {}
3143 static inline void kcov_task_exit(struct task_struct *t) {}
44+static inline void kcov_prepare_switch(struct task_struct *t) {}
45+static inline void kcov_finish_switch(struct task_struct *t) {}
3246
3347 #endif /* CONFIG_KCOV */
3448 #endif /* _LINUX_KCOV_H */
include/linux/memcontrol.h+22−4
@@ -53,6 +53,7 @@ enum memcg_memory_event { · 52 unmodified lines
5353 MEMCG_HIGH,
5454 MEMCG_MAX,
5555 MEMCG_OOM,
56+ MEMCG_OOM_KILL,
5657 MEMCG_SWAP_MAX,
5758 MEMCG_SWAP_FAIL,
5859 MEMCG_NR_MEMORY_EVENTS,
@@ -720,11 +721,8 @@ static inline void count_memcg_event_mm(struct mm_struct *mm, · 661 unmodified lines
720721
721722 rcu_read_lock();
722723 memcg = mem_cgroup_from_task(rcu_dereference(mm->owner));
723− if (likely(memcg)) {
724+ if (likely(memcg))
724725 count_memcg_events(memcg, idx, 1);
725− if (idx == OOM_KILL)
726− cgroup_file_notify(&memcg->events_file);
727− }
728726 rcu_read_unlock();
729727 }
730728
@@ -735,6 +733,21 @@ static inline void memcg_memory_event(struct mem_cgroup *memcg, · 4 unmodified lines
735733 cgroup_file_notify(&memcg->events_file);
736734 }
737735
736+static inline void memcg_memory_event_mm(struct mm_struct *mm,
737+ enum memcg_memory_event event)
738+{
739+ struct mem_cgroup *memcg;
740+
741+ if (mem_cgroup_disabled())
742+ return;
743+
744+ rcu_read_lock();
745+ memcg = mem_cgroup_from_task(rcu_dereference(mm->owner));
746+ if (likely(memcg))
747+ memcg_memory_event(memcg, event);
748+ rcu_read_unlock();
749+}
750+
738751 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
739752 void mem_cgroup_split_huge_fixup(struct page *head);
740753 #endif
@@ -756,6 +769,11 @@ static inline void memcg_memory_event(struct mem_cgroup *memcg, · 15 unmodified lines
756769 {
757770 }
758771
772+static inline void memcg_memory_event_mm(struct mm_struct *mm,
773+ enum memcg_memory_event event)
774+{
775+}
776+
759777 static inline enum mem_cgroup_protection mem_cgroup_protected(
760778 struct mem_cgroup *root, struct mem_cgroup *memcg)
761779 {
include/linux/sched.h+1−1
@@ -1130,7 +1130,7 @@ struct task_struct { · 1129 unmodified lines
11301130
11311131 #ifdef CONFIG_KCOV
11321132 /* Coverage collection mode enabled for this task (0 if disabled): */
1133− enum kcov_mode kcov_mode;
1133+ unsigned int kcov_mode;
11341134
11351135 /* Size of the kcov_area: */
11361136 unsigned int kcov_size;
include/linux/slab.h+1−0
@@ -600,6 +600,7 @@ struct memcg_cache_params { · 599 unmodified lines
600600 struct memcg_cache_array __rcu *memcg_caches;
601601 struct list_head __root_caches_node;
602602 struct list_head children;
603+ bool dying;
603604 };
604605 struct {
605606 struct mem_cgroup *memcg;