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
22 KCOV_MODE_TRACE_CMP = 3,22 KCOV_MODE_TRACE_CMP = 3,
23};23};
24 24
25#define KCOV_IN_CTXSW (1 << 30)
26
25void kcov_task_init(struct task_struct *t);27void kcov_task_init(struct task_struct *t);
26void kcov_task_exit(struct task_struct *t);28void kcov_task_exit(struct task_struct *t);
27 29
30#define kcov_prepare_switch(t) \
31do { \
32 (t)->kcov_mode |= KCOV_IN_CTXSW; \
33} while (0)
34
35#define kcov_finish_switch(t) \
36do { \
37 (t)->kcov_mode &= ~KCOV_IN_CTXSW; \
38} while (0)
39
28#else40#else
29 41
30static inline void kcov_task_init(struct task_struct *t) {}42static inline void kcov_task_init(struct task_struct *t) {}
31static inline void kcov_task_exit(struct task_struct *t) {}43static inline void kcov_task_exit(struct task_struct *t) {}
44static inline void kcov_prepare_switch(struct task_struct *t) {}
45static inline void kcov_finish_switch(struct task_struct *t) {}
32 46
33#endif /* CONFIG_KCOV */47#endif /* CONFIG_KCOV */
34#endif /* _LINUX_KCOV_H */48#endif /* _LINUX_KCOV_H */
include/linux/memcontrol.h+22−4
@@ -53,6 +53,7 @@ enum memcg_memory_event { · 52 unmodified lines
53 MEMCG_HIGH,53 MEMCG_HIGH,
54 MEMCG_MAX,54 MEMCG_MAX,
55 MEMCG_OOM,55 MEMCG_OOM,
56 MEMCG_OOM_KILL,
56 MEMCG_SWAP_MAX,57 MEMCG_SWAP_MAX,
57 MEMCG_SWAP_FAIL,58 MEMCG_SWAP_FAIL,
58 MEMCG_NR_MEMORY_EVENTS,59 MEMCG_NR_MEMORY_EVENTS,
@@ -720,11 +721,8 @@ static inline void count_memcg_event_mm(struct mm_struct *mm, · 661 unmodified lines
720 721
721 rcu_read_lock();722 rcu_read_lock();
722 memcg = mem_cgroup_from_task(rcu_dereference(mm->owner));723 memcg = mem_cgroup_from_task(rcu_dereference(mm->owner));
723 if (likely(memcg)) {724 if (likely(memcg))
724 count_memcg_events(memcg, idx, 1);725 count_memcg_events(memcg, idx, 1);
725 if (idx == OOM_KILL)
726 cgroup_file_notify(&memcg->events_file);
727 }
728 rcu_read_unlock();726 rcu_read_unlock();
729}727}
730 728
@@ -735,6 +733,21 @@ static inline void memcg_memory_event(struct mem_cgroup *memcg, · 4 unmodified lines
735 cgroup_file_notify(&memcg->events_file);733 cgroup_file_notify(&memcg->events_file);
736}734}
737 735
736static 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
738#ifdef CONFIG_TRANSPARENT_HUGEPAGE751#ifdef CONFIG_TRANSPARENT_HUGEPAGE
739void mem_cgroup_split_huge_fixup(struct page *head);752void mem_cgroup_split_huge_fixup(struct page *head);
740#endif753#endif
@@ -756,6 +769,11 @@ static inline void memcg_memory_event(struct mem_cgroup *memcg, · 15 unmodified lines
756{769{
757}770}
758 771
772static inline void memcg_memory_event_mm(struct mm_struct *mm,
773 enum memcg_memory_event event)
774{
775}
776
759static inline enum mem_cgroup_protection mem_cgroup_protected(777static inline enum mem_cgroup_protection mem_cgroup_protected(
760 struct mem_cgroup *root, struct mem_cgroup *memcg)778 struct mem_cgroup *root, struct mem_cgroup *memcg)
761{779{
include/linux/sched.h+1−1
@@ -1130,7 +1130,7 @@ struct task_struct { · 1129 unmodified lines
1130 1130
1131#ifdef CONFIG_KCOV1131#ifdef CONFIG_KCOV
1132 /* Coverage collection mode enabled for this task (0 if disabled): */1132 /* Coverage collection mode enabled for this task (0 if disabled): */
1133 enum kcov_mode kcov_mode;1133 unsigned int kcov_mode;
1134 1134
1135 /* Size of the kcov_area: */1135 /* Size of the kcov_area: */
1136 unsigned int kcov_size;1136 unsigned int kcov_size;
include/linux/slab.h+1−0
@@ -600,6 +600,7 @@ struct memcg_cache_params { · 599 unmodified lines
600 struct memcg_cache_array __rcu *memcg_caches;600 struct memcg_cache_array __rcu *memcg_caches;
601 struct list_head __root_caches_node;601 struct list_head __root_caches_node;
602 struct list_head children;602 struct list_head children;
603 bool dying;
603 };604 };
604 struct {605 struct {
605 struct mem_cgroup *memcg;606 struct mem_cgroup *memcg;