summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2015-11-07 19:16:23 +0100
committerThomas Gleixner <tglx@linutronix.de>2015-11-07 19:16:23 +0100
commit213397b608b539ee53fd3a8baddb5120e04054d5 (patch)
treecc2257b80e58e8f7b47ed4a2b26aafaa396427bc
parentb3c7938b7046902ca9e3b6922865dcc80ed0c482 (diff)
download4.8-rt-patches-213397b608b539ee53fd3a8baddb5120e04054d5.tar.gz
[ANNOUNCE] v4.1.12-rt13
Dear RT folks! I'm pleased to announce the v4.1.12-rt13 patch set. v4.1.12-rt12 is a non-announced update to incorporate the linux-4.1.y stable tree. Changes since v4.1.10-rt11: Yang Shi (1): bpf: Convert hashtab lock to raw lock Thomas Gleixner(2) rtmutex: Handle non enqueued waiters gracefully v4.1.12-rt13 Known issues: - bcache stays disabled - CPU hotplug is not better than before - The netlink_release() OOPS, reported by Clark, is still on the list, but unsolved due to lack of information The delta patch against 4.1.12-rt12 is appended below and can be found here: https://www.kernel.org/pub/linux/kernel/projects/rt/4.1/incr/patch-4.1.12-rt12-rt13.patch.xz You can get this release via the git tree at: git://git.kernel.org/pub/scm/linux/kernel/git/rt/linux-rt-devel.git v4.1.12-rt13 The RT patch against 4.1.12 can be found here: https://cdn.kernel.org/pub/linux/kernel/projects/rt/4.1/patch-4.1.12-rt13.patch.xz The split quilt queue is available at: https://cdn.kernel.org/pub/linux/kernel/projects/rt/4.1/patches-4.1.12-rt13.tar.xz Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--patches/bpf-convert-hashtab-lock-to-raw-lock.patch125
-rw-r--r--patches/localversion.patch4
-rw-r--r--patches/rtmutex--Handle-non-enqueued-waiters-gracefully34
-rw-r--r--patches/series3
4 files changed, 164 insertions, 2 deletions
diff --git a/patches/bpf-convert-hashtab-lock-to-raw-lock.patch b/patches/bpf-convert-hashtab-lock-to-raw-lock.patch
new file mode 100644
index 00000000000000..615f26872e7c48
--- /dev/null
+++ b/patches/bpf-convert-hashtab-lock-to-raw-lock.patch
@@ -0,0 +1,125 @@
+Subject: bpf: Convert hashtab lock to raw lock
+From: Yang Shi <yang.shi@linaro.org>
+Date: Fri, 30 Oct 2015 15:16:26 -0700
+
+When running bpf samples on rt kernel, it reports the below warning:
+
+BUG: sleeping function called from invalid context at kernel/locking/rtmutex.c:917
+in_atomic(): 1, irqs_disabled(): 128, pid: 477, name: ping
+Preemption disabled at:[<ffff80000017db58>] kprobe_perf_func+0x30/0x228
+
+CPU: 3 PID: 477 Comm: ping Not tainted 4.1.10-rt8 #4
+Hardware name: Freescale Layerscape 2085a RDB Board (DT)
+Call trace:
+[<ffff80000008a5b0>] dump_backtrace+0x0/0x128
+[<ffff80000008a6f8>] show_stack+0x20/0x30
+[<ffff8000007da90c>] dump_stack+0x7c/0xa0
+[<ffff8000000e4830>] ___might_sleep+0x188/0x1a0
+[<ffff8000007e2200>] rt_spin_lock+0x28/0x40
+[<ffff80000018bf9c>] htab_map_update_elem+0x124/0x320
+[<ffff80000018c718>] bpf_map_update_elem+0x40/0x58
+[<ffff800000187658>] __bpf_prog_run+0xd48/0x1640
+[<ffff80000017ca6c>] trace_call_bpf+0x8c/0x100
+[<ffff80000017db58>] kprobe_perf_func+0x30/0x228
+[<ffff80000017dd84>] kprobe_dispatcher+0x34/0x58
+[<ffff8000007e399c>] kprobe_handler+0x114/0x250
+[<ffff8000007e3bf4>] kprobe_breakpoint_handler+0x1c/0x30
+[<ffff800000085b80>] brk_handler+0x88/0x98
+[<ffff8000000822f0>] do_debug_exception+0x50/0xb8
+Exception stack(0xffff808349687460 to 0xffff808349687580)
+7460: 4ca2b600 ffff8083 4a3a7000 ffff8083 49687620 ffff8083 0069c5f8 ffff8000
+7480: 00000001 00000000 007e0628 ffff8000 496874b0 ffff8083 007e1de8 ffff8000
+74a0: 496874d0 ffff8083 0008e04c ffff8000 00000001 00000000 4ca2b600 ffff8083
+74c0: 00ba2e80 ffff8000 49687528 ffff8083 49687510 ffff8083 000e5c70 ffff8000
+74e0: 00c22348 ffff8000 00000000 ffff8083 49687510 ffff8083 000e5c74 ffff8000
+7500: 4ca2b600 ffff8083 49401800 ffff8083 00000001 00000000 00000000 00000000
+7520: 496874d0 ffff8083 00000000 00000000 00000000 00000000 00000000 00000000
+7540: 2f2e2d2c 33323130 00000000 00000000 4c944500 ffff8083 00000000 00000000
+7560: 00000000 00000000 008751e0 ffff8000 00000001 00000000 124e2d1d 00107b77
+
+Convert hashtab lock to raw lock to avoid such warning.
+
+Signed-off-by: Yang Shi <yang.shi@linaro.org>
+Cc: linaro-kernel@lists.linaro.org
+Cc: ast@kernel.org
+Cc: rostedt@goodmis.org
+Link: http://lkml.kernel.org/r/1446243386-26582-1-git-send-email-yang.shi@linaro.org
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+---
+This patch is applicable to mainline kernel too.
+
+ kernel/bpf/hashtab.c | 14 +++++++-------
+ 1 file changed, 7 insertions(+), 7 deletions(-)
+
+diff --git a/kernel/bpf/hashtab.c b/kernel/bpf/hashtab.c
+index 83c209d..972b76b 100644
+--- a/kernel/bpf/hashtab.c
++++ b/kernel/bpf/hashtab.c
+@@ -17,7 +17,7 @@
+ struct bpf_htab {
+ struct bpf_map map;
+ struct hlist_head *buckets;
+- spinlock_t lock;
++ raw_spinlock_t lock;
+ u32 count; /* number of elements in this hashtable */
+ u32 n_buckets; /* number of hash buckets */
+ u32 elem_size; /* size of each element in bytes */
+@@ -82,7 +82,7 @@ static struct bpf_map *htab_map_alloc(union bpf_attr *attr)
+ for (i = 0; i < htab->n_buckets; i++)
+ INIT_HLIST_HEAD(&htab->buckets[i]);
+
+- spin_lock_init(&htab->lock);
++ raw_spin_lock_init(&htab->lock);
+ htab->count = 0;
+
+ htab->elem_size = sizeof(struct htab_elem) +
+@@ -230,7 +230,7 @@ static int htab_map_update_elem(struct bpf_map *map, void *key, void *value,
+ l_new->hash = htab_map_hash(l_new->key, key_size);
+
+ /* bpf_map_update_elem() can be called in_irq() */
+- spin_lock_irqsave(&htab->lock, flags);
++ raw_spin_lock_irqsave(&htab->lock, flags);
+
+ head = select_bucket(htab, l_new->hash);
+
+@@ -266,11 +266,11 @@ static int htab_map_update_elem(struct bpf_map *map, void *key, void *value,
+ } else {
+ htab->count++;
+ }
+- spin_unlock_irqrestore(&htab->lock, flags);
++ raw_spin_unlock_irqrestore(&htab->lock, flags);
+
+ return 0;
+ err:
+- spin_unlock_irqrestore(&htab->lock, flags);
++ raw_spin_unlock_irqrestore(&htab->lock, flags);
+ kfree(l_new);
+ return ret;
+ }
+@@ -291,7 +291,7 @@ static int htab_map_delete_elem(struct bpf_map *map, void *key)
+
+ hash = htab_map_hash(key, key_size);
+
+- spin_lock_irqsave(&htab->lock, flags);
++ raw_spin_lock_irqsave(&htab->lock, flags);
+
+ head = select_bucket(htab, hash);
+
+@@ -304,7 +304,7 @@ static int htab_map_delete_elem(struct bpf_map *map, void *key)
+ ret = 0;
+ }
+
+- spin_unlock_irqrestore(&htab->lock, flags);
++ raw_spin_unlock_irqrestore(&htab->lock, flags);
+ return ret;
+ }
+
+--
+2.0.2
+
+--
+To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
+the body of a message to majordomo@vger.kernel.org
+More majordomo info at http://vger.kernel.org/majordomo-info.html
+
+
diff --git a/patches/localversion.patch b/patches/localversion.patch
index 51430b78045b11..b7a1739210b8c1 100644
--- a/patches/localversion.patch
+++ b/patches/localversion.patch
@@ -1,4 +1,4 @@
-Subject: v4.1.12-rt12
+Subject: v4.1.12-rt13
From: Thomas Gleixner <tglx@linutronix.de>
Date: Fri, 08 Jul 2011 20:25:16 +0200
@@ -12,4 +12,4 @@ Index: linux-rt-devel/localversion-rt
--- /dev/null
+++ linux-rt-devel/localversion-rt
@@ -0,0 +1 @@
-+-rt12
++-rt13
diff --git a/patches/rtmutex--Handle-non-enqueued-waiters-gracefully b/patches/rtmutex--Handle-non-enqueued-waiters-gracefully
new file mode 100644
index 00000000000000..98ba033e25f3bd
--- /dev/null
+++ b/patches/rtmutex--Handle-non-enqueued-waiters-gracefully
@@ -0,0 +1,34 @@
+Subject: rtmutex: Handle non enqueued waiters gracefully
+From: Thomas Gleixner <tglx@linutronix.de>
+Date: Fri, 06 Nov 2015 18:51:03 +0100
+
+Yimin debugged that in case of a PI wakeup in progress when
+rt_mutex_start_proxy_lock() calls task_blocks_on_rt_mutex() the latter
+returns -EAGAIN and in consequence the remove_waiter() call runs into
+a BUG_ON() because there is nothing to remove.
+
+Guard it with rt_mutex_has_waiters(). This is a quick fix which is
+easy to backport. The proper fix is to have a central check in
+remove_waiter() so we can call it unconditionally.
+
+Reported-and-debugged-by: Yimin Deng <yimin11.deng@gmail.com>
+Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
+Cc: stable-rt@vger.kernel.org
+
+---
+ kernel/locking/rtmutex.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: linux-rt-devel/kernel/locking/rtmutex.c
+===================================================================
+--- linux-rt-devel.orig/kernel/locking/rtmutex.c
++++ linux-rt-devel/kernel/locking/rtmutex.c
+@@ -2141,7 +2141,7 @@ int rt_mutex_start_proxy_lock(struct rt_
+ ret = 0;
+ }
+
+- if (unlikely(ret))
++ if (ret && rt_mutex_has_waiters(lock))
+ remove_waiter(lock, waiter);
+
+ raw_spin_unlock(&lock->wait_lock);
diff --git a/patches/series b/patches/series
index ee2fa59aa0107f..3fb0a5aa1f54d7 100644
--- a/patches/series
+++ b/patches/series
@@ -32,6 +32,7 @@ xfs--clean-up-inode-lockdep-annotations
mm-slub-move-slab-initialization-into-irq-enabled-region.patch
arm64-convert-patch_lock-to-raw-lock.patch
arm64-replace-read_lock-to-rcu-lock-in-call_break_hook.patch
+bpf-convert-hashtab-lock-to-raw-lock.patch
############################################################
# Stuff broken upstream, patches submitted
@@ -49,6 +50,8 @@ rfc-arm-smp-__cpu_disable-fix-sleeping-function-called-from-invalid-context.patc
# Stuff broken upstream, need to be sent
############################################################
+rtmutex--Handle-non-enqueued-waiters-gracefully
+
############################################################
# Submitted on LKML
############################################################