diff options
author | Paul Gortmaker <paul.gortmaker@windriver.com> | 2016-12-26 00:53:42 -0500 |
---|---|---|
committer | Paul Gortmaker <paul.gortmaker@windriver.com> | 2016-12-26 00:55:28 -0500 |
commit | ecbb1b433b774cffdb20f1caabcfac32d3b6915f (patch) | |
tree | 9dc70288599c5684875056ca9d6229f91abf8533 | |
parent | 8d1b675aaae467861775fe21c2367c207029c05c (diff) | |
download | 4.9-rt-patches-ecbb1b433b774cffdb20f1caabcfac32d3b6915f.tar.gz |
workqueue: import refresh with rcu_read_lock conversion squishedrt-v4.8-10067-g513a4befae06
-rw-r--r-- | patches/series | 1 | ||||
-rw-r--r-- | patches/workqueue-use-locallock.patch | 32 | ||||
-rw-r--r-- | patches/workqueue-use-rcu_readlock-in-put_pwq_unlocked.patch | 49 |
3 files changed, 17 insertions, 65 deletions
diff --git a/patches/series b/patches/series index bb821029d05093..66f77404dd1636 100644 --- a/patches/series +++ b/patches/series @@ -401,7 +401,6 @@ fs-dcache-use-swait_queue-instead-of-waitqueue.patch # WORKQUEUE more fixes workqueue-use-rcu.patch workqueue-use-locallock.patch -workqueue-use-rcu_readlock-in-put_pwq_unlocked.patch work-queue-work-around-irqsafe-timer-optimization.patch workqueue-distangle-from-rq-lock.patch diff --git a/patches/workqueue-use-locallock.patch b/patches/workqueue-use-locallock.patch index e03df16434a898..ffc72b923722ce 100644 --- a/patches/workqueue-use-locallock.patch +++ b/patches/workqueue-use-locallock.patch @@ -7,8 +7,8 @@ semantic of irq-off in regard to the pool->lock and remain preemptible. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> --- - kernel/workqueue.c | 31 +++++++++++++++++-------------- - 1 file changed, 17 insertions(+), 14 deletions(-) + kernel/workqueue.c | 33 +++++++++++++++++++-------------- + 1 file changed, 19 insertions(+), 14 deletions(-) --- a/kernel/workqueue.c +++ b/kernel/workqueue.c @@ -29,19 +29,21 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> static int worker_thread(void *__worker); static void workqueue_sysfs_unregister(struct workqueue_struct *wq); -@@ -1101,9 +1104,9 @@ static void put_pwq_unlocked(struct pool +@@ -1101,9 +1104,11 @@ static void put_pwq_unlocked(struct pool * As both pwqs and pools are RCU protected, the * following lock operations are safe. */ - spin_lock_irq(&pwq->pool->lock); ++ rcu_read_lock(); + local_spin_lock_irq(pendingb_lock, &pwq->pool->lock); put_pwq(pwq); - spin_unlock_irq(&pwq->pool->lock); + local_spin_unlock_irq(pendingb_lock, &pwq->pool->lock); ++ rcu_read_unlock(); } } -@@ -1207,7 +1210,7 @@ static int try_to_grab_pending(struct wo +@@ -1207,7 +1212,7 @@ static int try_to_grab_pending(struct wo struct worker_pool *pool; struct pool_workqueue *pwq; @@ -50,7 +52,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> /* try to steal the timer if it exists */ if (is_dwork) { -@@ -1271,7 +1274,7 @@ static int try_to_grab_pending(struct wo +@@ -1271,7 +1276,7 @@ static int try_to_grab_pending(struct wo spin_unlock(&pool->lock); fail: rcu_read_unlock(); @@ -59,7 +61,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> if (work_is_canceling(work)) return -ENOENT; cpu_relax(); -@@ -1376,7 +1379,7 @@ static void __queue_work(int cpu, struct +@@ -1376,7 +1381,7 @@ static void __queue_work(int cpu, struct * queued or lose PENDING. Grabbing PENDING and queueing should * happen with IRQ disabled. */ @@ -68,7 +70,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> debug_work_activate(work); -@@ -1482,14 +1485,14 @@ bool queue_work_on(int cpu, struct workq +@@ -1482,14 +1487,14 @@ bool queue_work_on(int cpu, struct workq bool ret = false; unsigned long flags; @@ -85,7 +87,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> return ret; } EXPORT_SYMBOL(queue_work_on); -@@ -1556,14 +1559,14 @@ bool queue_delayed_work_on(int cpu, stru +@@ -1556,14 +1561,14 @@ bool queue_delayed_work_on(int cpu, stru unsigned long flags; /* read the comment in __queue_work() */ @@ -102,7 +104,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> return ret; } EXPORT_SYMBOL(queue_delayed_work_on); -@@ -1598,7 +1601,7 @@ bool mod_delayed_work_on(int cpu, struct +@@ -1598,7 +1603,7 @@ bool mod_delayed_work_on(int cpu, struct if (likely(ret >= 0)) { __queue_delayed_work(cpu, wq, dwork, delay); @@ -111,7 +113,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> } /* -ENOENT from try_to_grab_pending() becomes %true */ -@@ -2916,7 +2919,7 @@ static bool __cancel_work_timer(struct w +@@ -2916,7 +2921,7 @@ static bool __cancel_work_timer(struct w /* tell other tasks trying to grab @work to back off */ mark_work_canceling(work); @@ -120,7 +122,7 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> flush_work(work); clear_work_data(work); -@@ -2971,10 +2974,10 @@ EXPORT_SYMBOL_GPL(cancel_work_sync); +@@ -2971,10 +2976,10 @@ EXPORT_SYMBOL_GPL(cancel_work_sync); */ bool flush_delayed_work(struct delayed_work *dwork) { @@ -133,12 +135,12 @@ Signed-off-by: Thomas Gleixner <tglx@linutronix.de> return flush_work(&dwork->work); } EXPORT_SYMBOL(flush_delayed_work); -@@ -3009,7 +3012,7 @@ bool cancel_delayed_work(struct delayed_ +@@ -2992,7 +2997,7 @@ static bool __cancel_work(struct work_st + return false; - set_work_pool_and_clear_pending(&dwork->work, - get_work_pool_id(&dwork->work)); + set_work_pool_and_clear_pending(work, get_work_pool_id(work)); - local_irq_restore(flags); + local_unlock_irqrestore(pendingb_lock, flags); return ret; } - EXPORT_SYMBOL(cancel_delayed_work); + diff --git a/patches/workqueue-use-rcu_readlock-in-put_pwq_unlocked.patch b/patches/workqueue-use-rcu_readlock-in-put_pwq_unlocked.patch deleted file mode 100644 index 1c0ddee38c8b76..00000000000000 --- a/patches/workqueue-use-rcu_readlock-in-put_pwq_unlocked.patch +++ /dev/null @@ -1,49 +0,0 @@ -From: Sebastian Andrzej Siewior <bigeasy@linutronix.de> -Date: Mon, 12 Dec 2016 16:14:18 +0100 -Subject: [PATCH] workqueue: use rcu_readlock() in put_pwq_unlocked() - -The RCU sched protection was changed to RCU only and so all IRQ-off and -preempt-off disabled region were changed to the relevant rcu-read-lock -primitives. One was missed and triggered: -|[ BUG: bad unlock balance detected! ] -|4.4.30-rt41 #51 Tainted: G W -|btattach/345 is trying to release lock ( -|Unable to handle kernel paging request at virtual address 6b6b6bbb -|Backtrace: -|[<c016b5a0>] (lock_release) from [<c0804844>] (rt_spin_unlock+0x20/0x30) -|[<c0804824>] (rt_spin_unlock) from [<c0138954>] (put_pwq_unlocked+0xa4/0x118) -|[<c01388b0>] (put_pwq_unlocked) from [<c0138b2c>] (destroy_workqueue+0x164/0x1b0) -|[<c01389c8>] (destroy_workqueue) from [<c078e1ac>] (hci_unregister_dev+0x120/0x21c) -|[<c078e08c>] (hci_unregister_dev) from [<c054f658>] (hci_uart_tty_close+0x90/0xbc) -|[<c054f5c8>] (hci_uart_tty_close) from [<c03a2be8>] (tty_ldisc_close+0x50/0x58) -|[<c03a2b98>] (tty_ldisc_close) from [<c03a2cb4>] (tty_ldisc_kill+0x18/0x78) -|[<c03a2c9c>] (tty_ldisc_kill) from [<c03a3528>] (tty_ldisc_release+0x100/0x134) -|[<c03a3428>] (tty_ldisc_release) from [<c039cd68>] (tty_release+0x3bc/0x460) -|[<c039c9ac>] (tty_release) from [<c020cc08>] (__fput+0xe0/0x1b4) -|[<c020cb28>] (__fput) from [<c020cd3c>] (____fput+0x10/0x14) -|[<c020cd2c>] (____fput) from [<c013e0d4>] (task_work_run+0xa4/0xb8) -|[<c013e030>] (task_work_run) from [<c0121754>] (do_exit+0x40c/0x8b0) -|[<c0121348>] (do_exit) from [<c0122ff8>] (do_group_exit+0x54/0xc4) - -Cc: stable-rt@vger.kernel.org -Reported-by: John Keeping <john@metanate.com> -Tested-by: John Keeping <john@metanate.com> -Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> ---- - kernel/workqueue.c | 2 ++ - 1 file changed, 2 insertions(+) - ---- a/kernel/workqueue.c -+++ b/kernel/workqueue.c -@@ -1104,9 +1104,11 @@ static void put_pwq_unlocked(struct pool - * As both pwqs and pools are RCU protected, the - * following lock operations are safe. - */ -+ rcu_read_lock(); - local_spin_lock_irq(pendingb_lock, &pwq->pool->lock); - put_pwq(pwq); - local_spin_unlock_irq(pendingb_lock, &pwq->pool->lock); -+ rcu_read_unlock(); - } - } - |