summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/cpuset.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index 681a5d58d40..e04c2da9dad 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -647,10 +647,15 @@ void cpuset_update_task_memory_state()
struct task_struct *tsk = current;
struct cpuset *cs;
- rcu_read_lock();
- cs = rcu_dereference(tsk->cpuset);
- my_cpusets_mem_gen = cs->mems_generation;
- rcu_read_unlock();
+ if (tsk->cpuset == &top_cpuset) {
+ /* Don't need rcu for top_cpuset. It's never freed. */
+ my_cpusets_mem_gen = top_cpuset.mems_generation;
+ } else {
+ rcu_read_lock();
+ cs = rcu_dereference(tsk->cpuset);
+ my_cpusets_mem_gen = cs->mems_generation;
+ rcu_read_unlock();
+ }
if (my_cpusets_mem_gen != tsk->cpuset_mems_generation) {
down(&callback_sem);