core kernel fixes
Linus,
Please pull the latest core-fixes-for-linus git tree from:
git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git core-fixes-for-linus
Thanks,
Ingo
------------------>
Darren Hart (2):
futex: Check for NULL keys in match_futex
futex: Move drop_futex_key_refs out of spinlock'ed region
Paul E. McKenney (3):
rcu: Prevent RCU IPI storms in presence of high call_rcu() load
rcu: Stopgap fix for synchronize_rcu_expedited() for TREE_PREEMPT_RCU
rcu: Fix TREE_PREEMPT_RCU CPU_HOTPLUG bad-luck hang
Thomas Gleixner (1):
futex: Handle spurious wake up
include/linux/rcutree.h | 6 +----- kernel/futex.c | 24 +++++++++++++++++++----- kernel/rcutree.c | 44 ++++++++++++++++++++++++++++++++++++++------ kernel/rcutree.h | 10 +++++++--- kernel/rcutree_plugin.h | 46 ++++++++++++++++++++++++++++++++++++++-------- 5 files changed, 103 insertions(+), 27 deletions(-)
include/linux/rcutree.h +1 -5
@@ -76,11 +76,7 @@ static inline void __rcu_read_unlock_bh(void)extern void call_rcu_sched (struct rcu_head *head,void (*func)(struct rcu_head *rcu)); - -static inline void synchronize_rcu_expedited (void ) -{ -synchronize_sched_expedited (); -} +extern void synchronize_rcu_expedited (void );static inline void synchronize_rcu_bh_expedited (void ) {
kernel/futex.c +19 -5
@@ -150,7 +150,8 @@ static struct futex_hash_bucket *hash_futex(union futex_key *key)*/ static inline int match_futex (union futex_key *key1,union futex_key *key2) { -return (key1->both.word == key2->both.word +return (key1 && key2 + && key1->both.word == key2->both.word && key1->both.ptr == key2->both.ptr && key1->both.offset == key2->both.offset); }
@@ -1028,7 +1029,6 @@ static inlinevoid requeue_pi_wake_futex (struct futex_q *q,union futex_key *key,struct futex_hash_bucket *hb) { -drop_futex_key_refs (&q->key);get_futex_key_refs (key); q->key = *key;
@@ -1226,6 +1226,7 @@ retry_private:*/ if (ret ==1 ) {WARN_ON (pi_state); + drop_count++; task_count++; ret =get_futex_value_locked (&curval2, uaddr2);if (!ret)
@@ -1304,6 +1305,7 @@ retry_private:if (ret ==1 ) {/* We got the lock. */ requeue_pi_wake_futex (this, &key2, hb2); + drop_count++;continue ; }else if (ret) {/* -EDEADLK */
@@ -1791,6 +1793,7 @@ static int futex_wait(u32 __user *uaddr, int fshared, current->timer_slack_ns); } +retry:/* Prepare to wait on uaddr. */ ret =futex_wait_setup (uaddr, val, fshared, &q, &hb);if (ret)
@@ -1808,9 +1811,14 @@ static int futex_wait(u32 __user *uaddr, int fshared, goto out_put_key;/* -* We expect signal_pending(current), but another thread may -* have handled it for us already. +* We expect signal_pending(current), but we might be the +* victim of a spurious wakeup as well. */ +if (!signal_pending (current)) { +put_futex_key (fshared, &q.key); + goto retry; + } + ret = -ERESTARTSYS ;if (!abs_time) goto out_put_key;
@@ -2118,9 +2126,11 @@ int handle_early_requeue_pi_wakeup(struct futex_hash_bucket *hb,*/ plist_del (&q->list, &q->list.plist); +/* Handle spurious wakeups gracefully */ + ret = -EAGAIN ;if (timeout && !timeout->task) ret = -ETIMEDOUT ; -else +else if (signal_pending (current)) ret = -ERESTARTNOINTR ; }return ret;
@@ -2198,6 +2208,7 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, int fshared,debug_rt_mutex_init_waiter (&rt_waiter); rt_waiter.task =NULL ; +retry: key2 =FUTEX_KEY_INIT ; ret =get_futex_key (uaddr2, fshared, &key2,VERIFY_WRITE );if (unlikely (ret !=0 ))
@@ -2292,6 +2303,9 @@ out_put_keys: out_key2:put_futex_key (fshared, &key2); +/* Spurious wakeup ? */ +if (ret == -EAGAIN ) + goto retry; out:if (to) {hrtimer_cancel (&to->timer);
kernel/rcutree.c +38 -6
81 lines not on this page · raw message
kernel/rcutree.h +7 -3
@@ -167,6 +167,10 @@ struct rcu_data {struct rcu_head *nxtlist;struct rcu_head **nxttail[RCU_NEXT_SIZE ];long qlen;/* # of queued callbacks */ +long qlen_last_fqs_check; +/* qlen at last check for QS forcing */ +unsigned long n_force_qs_snap; +/* did other CPU force QS recently? */ long blimit;/* Upper limit on a processed batch */ #ifdef CONFIG_NO_HZ
@@ -302,9 +306,9 @@ static void rcu_print_task_stall(struct rcu_node *rnp);#endif /* #ifdef CONFIG_RCU_CPU_STALL_DETECTOR */ static void rcu_preempt_check_blocked_tasks (struct rcu_node *rnp);#ifdef CONFIG_HOTPLUG_CPU -static void rcu_preempt_offline_tasks (struct rcu_state *rsp, -struct rcu_node *rnp, -struct rcu_data *rdp); +static int rcu_preempt_offline_tasks (struct rcu_state *rsp, +struct rcu_node *rnp, +struct rcu_data *rdp);static void rcu_preempt_offline_cpu (int cpu);#endif /* #ifdef CONFIG_HOTPLUG_CPU */ static void rcu_preempt_check_callbacks (int cpu);
kernel/rcutree_plugin.h +38 -8
89 lines not on this page · raw message