From: Greg Kroah-Hartman Date: Wed, 24 Oct 2012 05:27:37 +0000 (-0700) Subject: 3.4-stable patches X-Git-Tag: v3.0.49~54 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=98e72a07794164a9d3a4f699306d291387e762bf;p=thirdparty%2Fkernel%2Fstable-queue.git 3.4-stable patches added patches: arch-tile-avoid-generating-.eh_frame-information-in-modules.patch ext4-avoid-underflow-in-ext4_trim_fs.patch nohz-fix-idle-ticks-in-cpu-summary-line-of-proc-stat.patch --- diff --git a/queue-3.4/arch-tile-avoid-generating-.eh_frame-information-in-modules.patch b/queue-3.4/arch-tile-avoid-generating-.eh_frame-information-in-modules.patch new file mode 100644 index 00000000000..65d9b6f6390 --- /dev/null +++ b/queue-3.4/arch-tile-avoid-generating-.eh_frame-information-in-modules.patch @@ -0,0 +1,37 @@ +From 627072b06c362bbe7dc256f618aaa63351f0cfe6 Mon Sep 17 00:00:00 2001 +From: Chris Metcalf +Date: Fri, 19 Oct 2012 11:43:11 -0400 +Subject: arch/tile: avoid generating .eh_frame information in modules + +From: Chris Metcalf + +commit 627072b06c362bbe7dc256f618aaa63351f0cfe6 upstream. + +The tile tool chain uses the .eh_frame information for backtracing. +The vmlinux build drops any .eh_frame sections at link time, but when +present in kernel modules, it causes a module load failure due to the +presence of unsupported pc-relative relocations. When compiling to +use compiler feedback support, the compiler by default omits .eh_frame +information, so we don't see this problem. But when not using feedback, +we need to explicitly suppress the .eh_frame. + +Signed-off-by: Chris Metcalf +Signed-off-by: Greg Kroah-Hartman + +--- + arch/tile/Makefile | 4 ++++ + 1 file changed, 4 insertions(+) + +--- a/arch/tile/Makefile ++++ b/arch/tile/Makefile +@@ -26,6 +26,10 @@ $(error Set TILERA_ROOT or CROSS_COMPILE + endif + endif + ++# The tile compiler may emit .eh_frame information for backtracing. ++# In kernel modules, this causes load failures due to unsupported relocations. ++KBUILD_CFLAGS += -fno-asynchronous-unwind-tables ++ + ifneq ($(CONFIG_DEBUG_EXTRA_FLAGS),"") + KBUILD_CFLAGS += $(CONFIG_DEBUG_EXTRA_FLAGS) + endif diff --git a/queue-3.4/ext4-avoid-underflow-in-ext4_trim_fs.patch b/queue-3.4/ext4-avoid-underflow-in-ext4_trim_fs.patch new file mode 100644 index 00000000000..8e6e701e219 --- /dev/null +++ b/queue-3.4/ext4-avoid-underflow-in-ext4_trim_fs.patch @@ -0,0 +1,37 @@ +From 5de35e8d5c02d271c20e18337e01bc20e6ef472e Mon Sep 17 00:00:00 2001 +From: Lukas Czerner +Date: Mon, 22 Oct 2012 18:01:19 -0400 +Subject: ext4: Avoid underflow in ext4_trim_fs() + +From: Lukas Czerner + +commit 5de35e8d5c02d271c20e18337e01bc20e6ef472e upstream. + +Currently if len argument in ext4_trim_fs() is smaller than one block, +the 'end' variable underflow. Avoid that by returning EINVAL if len is +smaller than file system block. + +Also remove useless unlikely(). + +Signed-off-by: Lukas Czerner +Signed-off-by: "Theodore Ts'o" +Signed-off-by: Greg Kroah-Hartman + +--- + fs/ext4/mballoc.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +--- a/fs/ext4/mballoc.c ++++ b/fs/ext4/mballoc.c +@@ -4984,8 +4984,9 @@ int ext4_trim_fs(struct super_block *sb, + end = start + (range->len >> sb->s_blocksize_bits) - 1; + minlen = range->minlen >> sb->s_blocksize_bits; + +- if (unlikely(minlen > EXT4_CLUSTERS_PER_GROUP(sb)) || +- unlikely(start >= max_blks)) ++ if (minlen > EXT4_CLUSTERS_PER_GROUP(sb) || ++ start >= max_blks || ++ range->len < sb->s_blocksize) + return -EINVAL; + if (end >= max_blks) + end = max_blks - 1; diff --git a/queue-3.4/nohz-fix-idle-ticks-in-cpu-summary-line-of-proc-stat.patch b/queue-3.4/nohz-fix-idle-ticks-in-cpu-summary-line-of-proc-stat.patch new file mode 100644 index 00000000000..0bf44150ff0 --- /dev/null +++ b/queue-3.4/nohz-fix-idle-ticks-in-cpu-summary-line-of-proc-stat.patch @@ -0,0 +1,75 @@ +From 7386cdbf2f57ea8cff3c9fde93f206e58b9fe13f Mon Sep 17 00:00:00 2001 +From: Michal Hocko +Date: Wed, 10 Oct 2012 11:51:09 +0530 +Subject: nohz: Fix idle ticks in cpu summary line of /proc/stat + +From: Michal Hocko + +commit 7386cdbf2f57ea8cff3c9fde93f206e58b9fe13f upstream. + +Git commit 09a1d34f8535ecf9 "nohz: Make idle/iowait counter update +conditional" introduced a bug in regard to cpu hotplug. The effect is +that the number of idle ticks in the cpu summary line in /proc/stat is +still counting ticks for offline cpus. + +Reproduction is easy, just start a workload that keeps all cpus busy, +switch off one or more cpus and then watch the idle field in top. +On a dual-core with one cpu 100% busy and one offline cpu you will get +something like this: + +%Cpu(s): 48.7 us, 1.3 sy, 0.0 ni, 50.0 id, 0.0 wa, 0.0 hi, 0.0 si, +%0.0 st + +The problem is that an offline cpu still has ts->idle_active == 1. +To fix this we should make sure that the cpu is online when calling +get_cpu_idle_time_us and get_cpu_iowait_time_us. + +[Srivatsa: Rebased to current mainline] + +Reported-by: Martin Schwidefsky +Signed-off-by: Michal Hocko +Reviewed-by: Srivatsa S. Bhat +Signed-off-by: Srivatsa S. Bhat +Link: http://lkml.kernel.org/r/20121010061820.8999.57245.stgit@srivatsabhat.in.ibm.com +Cc: deepthi@linux.vnet.ibm.com +Signed-off-by: Thomas Gleixner +Signed-off-by: Greg Kroah-Hartman + +--- + fs/proc/stat.c | 14 ++++++++++---- + 1 file changed, 10 insertions(+), 4 deletions(-) + +--- a/fs/proc/stat.c ++++ b/fs/proc/stat.c +@@ -45,10 +45,13 @@ static cputime64_t get_iowait_time(int c + + static u64 get_idle_time(int cpu) + { +- u64 idle, idle_time = get_cpu_idle_time_us(cpu, NULL); ++ u64 idle, idle_time = -1ULL; ++ ++ if (cpu_online(cpu)) ++ idle_time = get_cpu_idle_time_us(cpu, NULL); + + if (idle_time == -1ULL) +- /* !NO_HZ so we can rely on cpustat.idle */ ++ /* !NO_HZ or cpu offline so we can rely on cpustat.idle */ + idle = kcpustat_cpu(cpu).cpustat[CPUTIME_IDLE]; + else + idle = usecs_to_cputime64(idle_time); +@@ -58,10 +61,13 @@ static u64 get_idle_time(int cpu) + + static u64 get_iowait_time(int cpu) + { +- u64 iowait, iowait_time = get_cpu_iowait_time_us(cpu, NULL); ++ u64 iowait, iowait_time = -1ULL; ++ ++ if (cpu_online(cpu)) ++ iowait_time = get_cpu_iowait_time_us(cpu, NULL); + + if (iowait_time == -1ULL) +- /* !NO_HZ so we can rely on cpustat.iowait */ ++ /* !NO_HZ or cpu offline so we can rely on cpustat.iowait */ + iowait = kcpustat_cpu(cpu).cpustat[CPUTIME_IOWAIT]; + else + iowait = usecs_to_cputime64(iowait_time); diff --git a/queue-3.4/series b/queue-3.4/series index 8e5d04a2169..17b73173d7c 100644 --- a/queue-3.4/series +++ b/queue-3.4/series @@ -1 +1,4 @@ ext4-race-condition-protection-for-ext4_convert_unwritten_extents_endio.patch +ext4-avoid-underflow-in-ext4_trim_fs.patch +nohz-fix-idle-ticks-in-cpu-summary-line-of-proc-stat.patch +arch-tile-avoid-generating-.eh_frame-information-in-modules.patch