diff options
-rw-r--r-- | include/linux/sched.h | 3 | ||||
-rw-r--r-- | kernel/rcutree_plugin.h | 8 |
2 files changed, 9 insertions, 2 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 496770a96487..76676a407e4a 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -1254,6 +1254,9 @@ struct task_struct { | |||
1254 | #ifdef CONFIG_PREEMPT_RCU | 1254 | #ifdef CONFIG_PREEMPT_RCU |
1255 | int rcu_read_lock_nesting; | 1255 | int rcu_read_lock_nesting; |
1256 | char rcu_read_unlock_special; | 1256 | char rcu_read_unlock_special; |
1257 | #if defined(CONFIG_RCU_BOOST) && defined(CONFIG_TREE_PREEMPT_RCU) | ||
1258 | int rcu_boosted; | ||
1259 | #endif /* #if defined(CONFIG_RCU_BOOST) && defined(CONFIG_TREE_PREEMPT_RCU) */ | ||
1257 | struct list_head rcu_node_entry; | 1260 | struct list_head rcu_node_entry; |
1258 | #endif /* #ifdef CONFIG_PREEMPT_RCU */ | 1261 | #endif /* #ifdef CONFIG_PREEMPT_RCU */ |
1259 | #ifdef CONFIG_TREE_PREEMPT_RCU | 1262 | #ifdef CONFIG_TREE_PREEMPT_RCU |
diff --git a/kernel/rcutree_plugin.h b/kernel/rcutree_plugin.h index 6abef3cfcbc1..3a0ae0355222 100644 --- a/kernel/rcutree_plugin.h +++ b/kernel/rcutree_plugin.h | |||
@@ -342,6 +342,11 @@ static void rcu_read_unlock_special(struct task_struct *t) | |||
342 | #ifdef CONFIG_RCU_BOOST | 342 | #ifdef CONFIG_RCU_BOOST |
343 | if (&t->rcu_node_entry == rnp->boost_tasks) | 343 | if (&t->rcu_node_entry == rnp->boost_tasks) |
344 | rnp->boost_tasks = np; | 344 | rnp->boost_tasks = np; |
345 | /* Snapshot and clear ->rcu_boosted with rcu_node lock held. */ | ||
346 | if (t->rcu_boosted) { | ||
347 | special |= RCU_READ_UNLOCK_BOOSTED; | ||
348 | t->rcu_boosted = 0; | ||
349 | } | ||
345 | #endif /* #ifdef CONFIG_RCU_BOOST */ | 350 | #endif /* #ifdef CONFIG_RCU_BOOST */ |
346 | t->rcu_blocked_node = NULL; | 351 | t->rcu_blocked_node = NULL; |
347 | 352 | ||
@@ -358,7 +363,6 @@ static void rcu_read_unlock_special(struct task_struct *t) | |||
358 | #ifdef CONFIG_RCU_BOOST | 363 | #ifdef CONFIG_RCU_BOOST |
359 | /* Unboost if we were boosted. */ | 364 | /* Unboost if we were boosted. */ |
360 | if (special & RCU_READ_UNLOCK_BOOSTED) { | 365 | if (special & RCU_READ_UNLOCK_BOOSTED) { |
361 | t->rcu_read_unlock_special &= ~RCU_READ_UNLOCK_BOOSTED; | ||
362 | rt_mutex_unlock(t->rcu_boost_mutex); | 366 | rt_mutex_unlock(t->rcu_boost_mutex); |
363 | t->rcu_boost_mutex = NULL; | 367 | t->rcu_boost_mutex = NULL; |
364 | } | 368 | } |
@@ -1176,7 +1180,7 @@ static int rcu_boost(struct rcu_node *rnp) | |||
1176 | t = container_of(tb, struct task_struct, rcu_node_entry); | 1180 | t = container_of(tb, struct task_struct, rcu_node_entry); |
1177 | rt_mutex_init_proxy_locked(&mtx, t); | 1181 | rt_mutex_init_proxy_locked(&mtx, t); |
1178 | t->rcu_boost_mutex = &mtx; | 1182 | t->rcu_boost_mutex = &mtx; |
1179 | t->rcu_read_unlock_special |= RCU_READ_UNLOCK_BOOSTED; | 1183 | t->rcu_boosted = 1; |
1180 | raw_spin_unlock_irqrestore(&rnp->lock, flags); | 1184 | raw_spin_unlock_irqrestore(&rnp->lock, flags); |
1181 | rt_mutex_lock(&mtx); /* Side effect: boosts task t's priority. */ | 1185 | rt_mutex_lock(&mtx); /* Side effect: boosts task t's priority. */ |
1182 | rt_mutex_unlock(&mtx); /* Keep lockdep happy. */ | 1186 | rt_mutex_unlock(&mtx); /* Keep lockdep happy. */ |