History

Merge branch 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull scheduler fixes from Thomas Gleixner: "Two fixes for the fair scheduling class: - Prevent freeing memory which is accessible by concurrent readers - Make the RCU annotations for numa groups consistent" * 'sched-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: sched/fair: Use RCU accessors consistently for ->numa_group sched/fair: Don't free p->numa_faults with concurrent readers

Linus Torvalds committed 7 years ago

Commit e24ce842 parents 750991f cb361d85 files · +114 −48Browse files

Showing the changes to include/linux (2 of 5 files). Show all

Unified · Split

2 files
  1. include/linux/sched.h +9 −1
  2. include/linux/sched/numa_balancing.h +2 −2
include/linux/sched.h+9−1
@@ -1092,7 +1092,15 @@ struct task_struct { · 1091 unmodified lines
10921092 u64 last_sum_exec_runtime;
10931093 struct callback_head numa_work;
10941094
1095− struct numa_group *numa_group;
1095+ /*
1096+ * This pointer is only modified for current in syscall and
1097+ * pagefault context (and for tasks being destroyed), so it can be read
1098+ * from any of the following contexts:
1099+ * - RCU read-side critical section
1100+ * - current->numa_group from everywhere
1101+ * - task's runqueue locked, task not running
1102+ */
1103+ struct numa_group __rcu *numa_group;
10961104
10971105 /*
10981106 * numa_faults is an array split into four regions:
include/linux/sched/numa_balancing.h+2−2
@@ -19,7 +19,7 @@ · 18 unmodified lines
1919 extern void task_numa_fault(int last_node, int node, int pages, int flags);
2020 extern pid_t task_numa_group_id(struct task_struct *p);
2121 extern void set_numabalancing_state(bool enabled);
22−extern void task_numa_free(struct task_struct *p);
22+extern void task_numa_free(struct task_struct *p, bool final);
2323 extern bool should_numa_migrate_memory(struct task_struct *p, struct page *page,
2424 int src_nid, int dst_cpu);
2525 #else
@@ -34,7 +34,7 @@ static inline pid_t task_numa_group_id(struct task_struct *p) · 8 unmodified lines
3434 static inline void set_numabalancing_state(bool enabled)
3535 {
3636 }
37−static inline void task_numa_free(struct task_struct *p)
37+static inline void task_numa_free(struct task_struct *p, bool final)
3838 {
3939 }
4040 static inline bool should_numa_migrate_memory(struct task_struct *p,