From: Greg Kroah-Hartman Date: Tue, 20 Nov 2012 19:03:01 +0000 (-0800) Subject: 3.0-stable patches X-Git-Tag: v3.0.53~23^2~9 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e1ba3fdd950432deb378292b0ad1c1a51ace59e1;p=thirdparty%2Fkernel%2Fstable-queue.git 3.0-stable patches added patches: kbuild-fix-gcc-x-syntax.patch r8169-use-unlimited-dma-burst-for-tx.patch tmpfs-change-final-i_blocks-bug-to-warning.patch --- diff --git a/queue-3.0/kbuild-fix-gcc-x-syntax.patch b/queue-3.0/kbuild-fix-gcc-x-syntax.patch new file mode 100644 index 00000000000..8829f3cbc7d --- /dev/null +++ b/queue-3.0/kbuild-fix-gcc-x-syntax.patch @@ -0,0 +1,182 @@ +From b1e0d8b70fa31821ebca3965f2ef8619d7c5e316 Mon Sep 17 00:00:00 2001 +From: Jean Delvare +Date: Tue, 2 Oct 2012 16:42:36 +0200 +Subject: kbuild: Fix gcc -x syntax + +From: Jean Delvare + +commit b1e0d8b70fa31821ebca3965f2ef8619d7c5e316 upstream. + +The correct syntax for gcc -x is "gcc -x assembler", not +"gcc -xassembler". Even though the latter happens to work, the former +is what is documented in the manual page and thus what gcc wrappers +such as icecream do expect. + +This isn't a cosmetic change. The missing space prevents icecream from +recognizing compilation tasks it can't handle, leading to silent kernel +miscompilations. + +Besides me, credits go to Michael Matz and Dirk Mueller for +investigating the miscompilation issue and tracking it down to this +incorrect -x parameter syntax. + +Signed-off-by: Jean Delvare +Acked-by: Ingo Molnar +Cc: Bernhard Walle +Cc: Michal Marek +Cc: Ralf Baechle +Signed-off-by: Michal Marek +Signed-off-by: Greg Kroah-Hartman + + +--- + arch/mips/Makefile | 2 +- + arch/mips/kernel/Makefile | 2 +- + scripts/Kbuild.include | 12 ++++++------ + scripts/gcc-version.sh | 6 +++--- + scripts/gcc-x86_32-has-stack-protector.sh | 2 +- + scripts/gcc-x86_64-has-stack-protector.sh | 2 +- + scripts/kconfig/check.sh | 2 +- + scripts/kconfig/lxdialog/check-lxdialog.sh | 2 +- + tools/perf/Makefile | 2 +- + 9 files changed, 16 insertions(+), 16 deletions(-) + +--- a/arch/mips/Makefile ++++ b/arch/mips/Makefile +@@ -236,7 +236,7 @@ KBUILD_CPPFLAGS += -D"DATAOFFSET=$(if $( + LDFLAGS += -m $(ld-emul) + + ifdef CONFIG_MIPS +-CHECKFLAGS += $(shell $(CC) $(KBUILD_CFLAGS) -dM -E -xc /dev/null | \ ++CHECKFLAGS += $(shell $(CC) $(KBUILD_CFLAGS) -dM -E -x c /dev/null | \ + egrep -vw '__GNUC_(|MINOR_|PATCHLEVEL_)_' | \ + sed -e 's/^\#define /-D/' -e "s/ /='/" -e "s/$$/'/") + ifdef CONFIG_64BIT +--- a/arch/mips/kernel/Makefile ++++ b/arch/mips/kernel/Makefile +@@ -100,7 +100,7 @@ obj-$(CONFIG_MIPS_MACHINE) += mips_machi + + obj-$(CONFIG_OF) += prom.o + +-CFLAGS_cpu-bugs64.o = $(shell if $(CC) $(KBUILD_CFLAGS) -Wa,-mdaddi -c -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-DHAVE_AS_SET_DADDI"; fi) ++CFLAGS_cpu-bugs64.o = $(shell if $(CC) $(KBUILD_CFLAGS) -Wa,-mdaddi -c -o /dev/null -x c /dev/null >/dev/null 2>&1; then echo "-DHAVE_AS_SET_DADDI"; fi) + + obj-$(CONFIG_HAVE_STD_PC_SERIAL_PORT) += 8250-platform.o + +--- a/scripts/Kbuild.include ++++ b/scripts/Kbuild.include +@@ -94,24 +94,24 @@ try-run = $(shell set -e; \ + # Usage: cflags-y += $(call as-option,-Wa$(comma)-isa=foo,) + + as-option = $(call try-run,\ +- $(CC) $(KBUILD_CFLAGS) $(1) -c -xassembler /dev/null -o "$$TMP",$(1),$(2)) ++ $(CC) $(KBUILD_CFLAGS) $(1) -c -x assembler /dev/null -o "$$TMP",$(1),$(2)) + + # as-instr + # Usage: cflags-y += $(call as-instr,instr,option1,option2) + + as-instr = $(call try-run,\ +- /bin/echo -e "$(1)" | $(CC) $(KBUILD_AFLAGS) -c -xassembler -o "$$TMP" -,$(2),$(3)) ++ /bin/echo -e "$(1)" | $(CC) $(KBUILD_AFLAGS) -c -x assembler -o "$$TMP" -,$(2),$(3)) + + # cc-option + # Usage: cflags-y += $(call cc-option,-march=winchip-c6,-march=i586) + + cc-option = $(call try-run,\ +- $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -xc /dev/null -o "$$TMP",$(1),$(2)) ++ $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",$(1),$(2)) + + # cc-option-yn + # Usage: flag := $(call cc-option-yn,-march=winchip-c6) + cc-option-yn = $(call try-run,\ +- $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -xc /dev/null -o "$$TMP",y,n) ++ $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(1) -c -x c /dev/null -o "$$TMP",y,n) + + # cc-option-align + # Prefix align with either -falign or -malign +@@ -121,7 +121,7 @@ cc-option-align = $(subst -functions=0,, + # cc-disable-warning + # Usage: cflags-y += $(call cc-disable-warning,unused-but-set-variable) + cc-disable-warning = $(call try-run,\ +- $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -W$(strip $(1)) -c -xc /dev/null -o "$$TMP",-Wno-$(strip $(1))) ++ $(CC) $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) -W$(strip $(1)) -c -x c /dev/null -o "$$TMP",-Wno-$(strip $(1))) + + # cc-version + # Usage gcc-ver := $(call cc-version) +@@ -139,7 +139,7 @@ cc-ifversion = $(shell [ $(call cc-versi + # cc-ldoption + # Usage: ldflags += $(call cc-ldoption, -Wl$(comma)--hash-style=both) + cc-ldoption = $(call try-run,\ +- $(CC) $(1) -nostdlib -xc /dev/null -o "$$TMP",$(1),$(2)) ++ $(CC) $(1) -nostdlib -x c /dev/null -o "$$TMP",$(1),$(2)) + + # ld-option + # Usage: LDFLAGS += $(call ld-option, -X) +--- a/scripts/gcc-version.sh ++++ b/scripts/gcc-version.sh +@@ -22,10 +22,10 @@ if [ ${#compiler} -eq 0 ]; then + exit 1 + fi + +-MAJOR=$(echo __GNUC__ | $compiler -E -xc - | tail -n 1) +-MINOR=$(echo __GNUC_MINOR__ | $compiler -E -xc - | tail -n 1) ++MAJOR=$(echo __GNUC__ | $compiler -E -x c - | tail -n 1) ++MINOR=$(echo __GNUC_MINOR__ | $compiler -E -x c - | tail -n 1) + if [ "x$with_patchlevel" != "x" ] ; then +- PATCHLEVEL=$(echo __GNUC_PATCHLEVEL__ | $compiler -E -xc - | tail -n 1) ++ PATCHLEVEL=$(echo __GNUC_PATCHLEVEL__ | $compiler -E -x c - | tail -n 1) + printf "%02d%02d%02d\\n" $MAJOR $MINOR $PATCHLEVEL + else + printf "%02d%02d\\n" $MAJOR $MINOR +--- a/scripts/gcc-x86_32-has-stack-protector.sh ++++ b/scripts/gcc-x86_32-has-stack-protector.sh +@@ -1,6 +1,6 @@ + #!/bin/sh + +-echo "int foo(void) { char X[200]; return 3; }" | $* -S -xc -c -O0 -fstack-protector - -o - 2> /dev/null | grep -q "%gs" ++echo "int foo(void) { char X[200]; return 3; }" | $* -S -x c -c -O0 -fstack-protector - -o - 2> /dev/null | grep -q "%gs" + if [ "$?" -eq "0" ] ; then + echo y + else +--- a/scripts/gcc-x86_64-has-stack-protector.sh ++++ b/scripts/gcc-x86_64-has-stack-protector.sh +@@ -1,6 +1,6 @@ + #!/bin/sh + +-echo "int foo(void) { char X[200]; return 3; }" | $* -S -xc -c -O0 -mcmodel=kernel -fstack-protector - -o - 2> /dev/null | grep -q "%gs" ++echo "int foo(void) { char X[200]; return 3; }" | $* -S -x c -c -O0 -mcmodel=kernel -fstack-protector - -o - 2> /dev/null | grep -q "%gs" + if [ "$?" -eq "0" ] ; then + echo y + else +--- a/scripts/kconfig/check.sh ++++ b/scripts/kconfig/check.sh +@@ -1,6 +1,6 @@ + #!/bin/sh + # Needed for systems without gettext +-$* -xc -o /dev/null - > /dev/null 2>&1 << EOF ++$* -x c -o /dev/null - > /dev/null 2>&1 << EOF + #include + int main() + { +--- a/scripts/kconfig/lxdialog/check-lxdialog.sh ++++ b/scripts/kconfig/lxdialog/check-lxdialog.sh +@@ -38,7 +38,7 @@ trap "rm -f $tmp" 0 1 2 3 15 + + # Check if we can link to ncurses + check() { +- $cc -xc - -o $tmp 2>/dev/null <<'EOF' ++ $cc -x c - -o $tmp 2>/dev/null <<'EOF' + #include CURSES_LOC + main() {} + EOF +--- a/tools/perf/Makefile ++++ b/tools/perf/Makefile +@@ -54,7 +54,7 @@ ifeq ($(ARCH),x86_64) + ARCH := x86 + IS_X86_64 := 0 + ifeq (, $(findstring m32,$(EXTRA_CFLAGS))) +- IS_X86_64 := $(shell echo __x86_64__ | ${CC} -E -xc - | tail -n 1) ++ IS_X86_64 := $(shell echo __x86_64__ | ${CC} -E -x c - | tail -n 1) + endif + ifeq (${IS_X86_64}, 1) + RAW_ARCH := x86_64 diff --git a/queue-3.0/r8169-use-unlimited-dma-burst-for-tx.patch b/queue-3.0/r8169-use-unlimited-dma-burst-for-tx.patch new file mode 100644 index 00000000000..4f6a3c72eb7 --- /dev/null +++ b/queue-3.0/r8169-use-unlimited-dma-burst-for-tx.patch @@ -0,0 +1,65 @@ +From aee77e4accbeb2c86b1d294cd84fec4a12dde3bd Mon Sep 17 00:00:00 2001 +From: Michal Schmidt +Date: Sun, 9 Sep 2012 13:55:26 +0000 +Subject: r8169: use unlimited DMA burst for TX + +From: Michal Schmidt + +commit aee77e4accbeb2c86b1d294cd84fec4a12dde3bd upstream. + +The r8169 driver currently limits the DMA burst for TX to 1024 bytes. I have +a box where this prevents the interface from using the gigabit line to its full +potential. This patch solves the problem by setting TX_DMA_BURST to unlimited. + +The box has an ASRock B75M motherboard with on-board RTL8168evl/8111evl +(XID 0c900880). TSO is enabled. + +I used netperf (TCP_STREAM test) to measure the dependency of TX throughput +on MTU. I did it for three different values of TX_DMA_BURST ('5'=512, '6'=1024, +'7'=unlimited). This chart shows the results: +http://michich.fedorapeople.org/r8169/r8169-effects-of-TX_DMA_BURST.png + +Interesting points: + - With the current DMA burst limit (1024): + - at the default MTU=1500 I get only 842 Mbit/s. + - when going from small MTU, the performance rises monotonically with + increasing MTU only up to a peak at MTU=1076 (908 MBit/s). Then there's + a sudden drop to 762 MBit/s from which the throughput rises monotonically + again with further MTU increases. + - With a smaller DMA burst limit (512): + - there's a similar peak at MTU=1076 and another one at MTU=564. + - With unlimited DMA burst: + - at the default MTU=1500 I get nice 940 Mbit/s. + - the throughput rises monotonically with increasing MTU with no strange + peaks. + +Notice that the peaks occur at MTU sizes that are multiples of the DMA burst +limit plus 52. Why 52? Because: + 20 (IP header) + 20 (TCP header) + 12 (TCP options) = 52 + +The Realtek-provided r8168 driver (v8.032.00) uses unlimited TX DMA burst too, +except for CFG_METHOD_1 where the TX DMA burst is set to 512 bytes. +CFG_METHOD_1 appears to be the oldest MAC version of "RTL8168B/8111B", +i.e. RTL_GIGA_MAC_VER_11 in r8169. Not sure if this MAC version really needs +the smaller burst limit, or if any other versions have similar requirements. + +Signed-off-by: Michal Schmidt +Acked-by: Francois Romieu +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/r8169.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/net/r8169.c ++++ b/drivers/net/r8169.c +@@ -75,7 +75,7 @@ static const int multicast_filter_limit + #define MAX_READ_REQUEST_SHIFT 12 + #define RX_FIFO_THRESH 7 /* 7 means NO threshold, Rx buffer level before first PCI xfer. */ + #define RX_DMA_BURST 6 /* Maximum PCI burst, '6' is 1024 */ +-#define TX_DMA_BURST 6 /* Maximum PCI burst, '6' is 1024 */ ++#define TX_DMA_BURST 7 /* Maximum PCI burst, '7' is unlimited */ + #define SafeMtu 0x1c20 /* ... actually life sucks beyond ~7k */ + #define InterFrameGap 0x03 /* 3 means InterFrameGap = the shortest one */ + diff --git a/queue-3.0/series b/queue-3.0/series index 5d12e1b8c93..3c0a97e0eba 100644 --- a/queue-3.0/series +++ b/queue-3.0/series @@ -13,3 +13,6 @@ ipv4-avoid-undefined-behavior-in-do_ip_setsockopt.patch ipv6-setsockopt-ipipproto_ipv6-ipv6_minhopcount-forgot-to-set-return-value.patch net-correct-check-in-dev_addr_del.patch net-rps-fix-brokeness-causing-ooo-packets.patch +tmpfs-change-final-i_blocks-bug-to-warning.patch +r8169-use-unlimited-dma-burst-for-tx.patch +kbuild-fix-gcc-x-syntax.patch diff --git a/queue-3.0/tmpfs-change-final-i_blocks-bug-to-warning.patch b/queue-3.0/tmpfs-change-final-i_blocks-bug-to-warning.patch new file mode 100644 index 00000000000..cfdc42e15aa --- /dev/null +++ b/queue-3.0/tmpfs-change-final-i_blocks-bug-to-warning.patch @@ -0,0 +1,54 @@ +From 0f3c42f522dc1ad7e27affc0a4aa8c790bce0a66 Mon Sep 17 00:00:00 2001 +From: Hugh Dickins +Date: Fri, 16 Nov 2012 14:15:04 -0800 +Subject: tmpfs: change final i_blocks BUG to WARNING +Status: RO +Content-Length: 1912 +Lines: 45 + +From: Hugh Dickins + +commit 0f3c42f522dc1ad7e27affc0a4aa8c790bce0a66 upstream. + +Under a particular load on one machine, I have hit shmem_evict_inode()'s +BUG_ON(inode->i_blocks), enough times to narrow it down to a particular +race between swapout and eviction. + +It comes from the "if (freed > 0)" asymmetry in shmem_recalc_inode(), +and the lack of coherent locking between mapping's nrpages and shmem's +swapped count. There's a window in shmem_writepage(), between lowering +nrpages in shmem_delete_from_page_cache() and then raising swapped +count, when the freed count appears to be +1 when it should be 0, and +then the asymmetry stops it from being corrected with -1 before hitting +the BUG. + +One answer is coherent locking: using tree_lock throughout, without +info->lock; reasonable, but the raw_spin_lock in percpu_counter_add() on +used_blocks makes that messier than expected. Another answer may be a +further effort to eliminate the weird shmem_recalc_inode() altogether, +but previous attempts at that failed. + +So far undecided, but for now change the BUG_ON to WARN_ON: in usual +circumstances it remains a useful consistency check. + +Signed-off-by: Hugh Dickins +Signed-off-by: Andrew Morton +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + + +--- + mm/shmem.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/mm/shmem.c ++++ b/mm/shmem.c +@@ -848,7 +848,7 @@ static void shmem_evict_inode(struct ino + kfree(xattr->name); + kfree(xattr); + } +- BUG_ON(inode->i_blocks); ++ WARN_ON(inode->i_blocks); + shmem_free_inode(inode->i_sb); + end_writeback(inode); + }