From: Greg Kroah-Hartman Date: Mon, 6 Oct 2014 00:04:49 +0000 (-0700) Subject: 3.10-stable patches X-Git-Tag: v3.10.57~29 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=eadf9583380f0e08ecfb26b1d80dc94bb36506b5;p=thirdparty%2Fkernel%2Fstable-queue.git 3.10-stable patches added patches: init-kconfig-fix-have_futex_cmpxchg-to-not-break-up-the-expert-menu.patch perf-fix-perf-bug-in-fork.patch ring-buffer-fix-infinite-spin-in-reading-buffer.patch --- diff --git a/queue-3.10/init-kconfig-fix-have_futex_cmpxchg-to-not-break-up-the-expert-menu.patch b/queue-3.10/init-kconfig-fix-have_futex_cmpxchg-to-not-break-up-the-expert-menu.patch new file mode 100644 index 00000000000..261c0241d12 --- /dev/null +++ b/queue-3.10/init-kconfig-fix-have_futex_cmpxchg-to-not-break-up-the-expert-menu.patch @@ -0,0 +1,41 @@ +From 62b4d2041117f35ab2409c9f5c4b8d3dc8e59d0f Mon Sep 17 00:00:00 2001 +From: Josh Triplett +Date: Fri, 3 Oct 2014 16:19:24 -0700 +Subject: init/Kconfig: Fix HAVE_FUTEX_CMPXCHG to not break up the EXPERT menu + +From: Josh Triplett + +commit 62b4d2041117f35ab2409c9f5c4b8d3dc8e59d0f upstream. + +commit 03b8c7b623c80af264c4c8d6111e5c6289933666 ("futex: Allow +architectures to skip futex_atomic_cmpxchg_inatomic() test") added the +HAVE_FUTEX_CMPXCHG symbol right below FUTEX. This placed it right in +the middle of the options for the EXPERT menu. However, +HAVE_FUTEX_CMPXCHG does not depend on EXPERT or FUTEX, so Kconfig stops +placing items in the EXPERT menu, and displays the remaining several +EXPERT items (starting with EPOLL) directly in the General Setup menu. + +Since both users of HAVE_FUTEX_CMPXCHG only select it "if FUTEX", make +HAVE_FUTEX_CMPXCHG itself depend on FUTEX. With this change, the +subsequent items display as part of the EXPERT menu again; the EMBEDDED +menu now appears as the next top-level item in the General Setup menu, +which makes General Setup much shorter and more usable. + +Signed-off-by: Josh Triplett +Acked-by: Randy Dunlap +Signed-off-by: Greg Kroah-Hartman + +--- + init/Kconfig | 1 + + 1 file changed, 1 insertion(+) + +--- a/init/Kconfig ++++ b/init/Kconfig +@@ -1367,6 +1367,7 @@ config FUTEX + + config HAVE_FUTEX_CMPXCHG + bool ++ depends on FUTEX + help + Architectures should select this if futex_atomic_cmpxchg_inatomic() + is implemented and always working. This removes a couple of runtime diff --git a/queue-3.10/perf-fix-perf-bug-in-fork.patch b/queue-3.10/perf-fix-perf-bug-in-fork.patch new file mode 100644 index 00000000000..2afd79faf47 --- /dev/null +++ b/queue-3.10/perf-fix-perf-bug-in-fork.patch @@ -0,0 +1,65 @@ +From 6c72e3501d0d62fc064d3680e5234f3463ec5a86 Mon Sep 17 00:00:00 2001 +From: Peter Zijlstra +Date: Thu, 2 Oct 2014 16:17:02 -0700 +Subject: perf: fix perf bug in fork() + +From: Peter Zijlstra + +commit 6c72e3501d0d62fc064d3680e5234f3463ec5a86 upstream. + +Oleg noticed that a cleanup by Sylvain actually uncovered a bug; by +calling perf_event_free_task() when failing sched_fork() we will not yet +have done the memset() on ->perf_event_ctxp[] and will therefore try and +'free' the inherited contexts, which are still in use by the parent +process. This is bad.. + +Suggested-by: Oleg Nesterov +Reported-by: Oleg Nesterov +Reported-by: Sylvain 'ythier' Hitier +Signed-off-by: Peter Zijlstra (Intel) +Cc: Ingo Molnar +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/events/core.c | 4 +++- + kernel/fork.c | 5 +++-- + 2 files changed, 6 insertions(+), 3 deletions(-) + +--- a/kernel/events/core.c ++++ b/kernel/events/core.c +@@ -7482,8 +7482,10 @@ int perf_event_init_task(struct task_str + + for_each_task_context_nr(ctxn) { + ret = perf_event_init_context(child, ctxn); +- if (ret) ++ if (ret) { ++ perf_event_free_task(child); + return ret; ++ } + } + + return 0; +--- a/kernel/fork.c ++++ b/kernel/fork.c +@@ -1324,7 +1324,7 @@ static struct task_struct *copy_process( + goto bad_fork_cleanup_policy; + retval = audit_alloc(p); + if (retval) +- goto bad_fork_cleanup_policy; ++ goto bad_fork_cleanup_perf; + /* copy all the process information */ + retval = copy_semundo(clone_flags, p); + if (retval) +@@ -1522,8 +1522,9 @@ bad_fork_cleanup_semundo: + exit_sem(p); + bad_fork_cleanup_audit: + audit_free(p); +-bad_fork_cleanup_policy: ++bad_fork_cleanup_perf: + perf_event_free_task(p); ++bad_fork_cleanup_policy: + #ifdef CONFIG_NUMA + mpol_put(p->mempolicy); + bad_fork_cleanup_cgroup: diff --git a/queue-3.10/ring-buffer-fix-infinite-spin-in-reading-buffer.patch b/queue-3.10/ring-buffer-fix-infinite-spin-in-reading-buffer.patch new file mode 100644 index 00000000000..6b23ec6e72a --- /dev/null +++ b/queue-3.10/ring-buffer-fix-infinite-spin-in-reading-buffer.patch @@ -0,0 +1,55 @@ +From 24607f114fd14f2f37e3e0cb3d47bce96e81e848 Mon Sep 17 00:00:00 2001 +From: "Steven Rostedt (Red Hat)" +Date: Thu, 2 Oct 2014 16:51:18 -0400 +Subject: ring-buffer: Fix infinite spin in reading buffer + +From: "Steven Rostedt (Red Hat)" + +commit 24607f114fd14f2f37e3e0cb3d47bce96e81e848 upstream. + +Commit 651e22f2701b "ring-buffer: Always reset iterator to reader page" +fixed one bug but in the process caused another one. The reset is to +update the header page, but that fix also changed the way the cached +reads were updated. The cache reads are used to test if an iterator +needs to be updated or not. + +A ring buffer iterator, when created, disables writes to the ring buffer +but does not stop other readers or consuming reads from happening. +Although all readers are synchronized via a lock, they are only +synchronized when in the ring buffer functions. Those functions may +be called by any number of readers. The iterator continues down when +its not interrupted by a consuming reader. If a consuming read +occurs, the iterator starts from the beginning of the buffer. + +The way the iterator sees that a consuming read has happened since +its last read is by checking the reader "cache". The cache holds the +last counts of the read and the reader page itself. + +Commit 651e22f2701b changed what was saved by the cache_read when +the rb_iter_reset() occurred, making the iterator never match the cache. +Then if the iterator calls rb_iter_reset(), it will go into an +infinite loop by checking if the cache doesn't match, doing the reset +and retrying, just to see that the cache still doesn't match! Which +should never happen as the reset is suppose to set the cache to the +current value and there's locks that keep a consuming reader from +having access to the data. + +Fixes: 651e22f2701b "ring-buffer: Always reset iterator to reader page" +Signed-off-by: Steven Rostedt +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/trace/ring_buffer.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/kernel/trace/ring_buffer.c ++++ b/kernel/trace/ring_buffer.c +@@ -3371,7 +3371,7 @@ static void rb_iter_reset(struct ring_bu + iter->head = cpu_buffer->reader_page->read; + + iter->cache_reader_page = iter->head_page; +- iter->cache_read = iter->head; ++ iter->cache_read = cpu_buffer->read; + + if (iter->head) + iter->read_stamp = cpu_buffer->read_stamp; diff --git a/queue-3.10/series b/queue-3.10/series index 88b44efd92d..f38e5f9b806 100644 --- a/queue-3.10/series +++ b/queue-3.10/series @@ -1 +1,4 @@ udf-avoid-infinite-loop-when-processing-indirect-icbs.patch +perf-fix-perf-bug-in-fork.patch +init-kconfig-fix-have_futex_cmpxchg-to-not-break-up-the-expert-menu.patch +ring-buffer-fix-infinite-spin-in-reading-buffer.patch