[OpenWrt-Devel] [PATCH RFC] kernel: drop -fno-reorder-blocks

Rafał Miłecki zajec5 at gmail.com
Tue Apr 9 05:30:46 EDT 2019


From: Rafał Miłecki <rafal at milecki.pl>

Dropping this option significantly improves NAT performance on BCM5301X
(bcm53xx) for LAN to WAN traffic with GRO disabled (+14%). It slightly
affects kernel size - it gets bigger by 1,5% - 3% depending on a target.

Unfortunately this change may decrease NAT performance for some other
platforms (targets). It seems to e.g. affect mt7621 with GRO enabled.

https://www.gnu.org/software/gcc/news/reorder.html

Following testing results come from OpenWrt with kernel 4.14.109 using
OpenWrt's default fq_codel.

**********

1) bcm53xx: BCM47094 SoC (echo 2 > rps_cpus)

zImage size: 1840424 → 1871328 (+1,68%)

a) gro off
LAN to WAN: 824 Mb/s → 940 Mb/s (+14,08%)
WAN to LAN: 935 Mb/s → 940 Mb/s (+0,53%)

b) gro on
LAN to WAN: 512 Mb/s → 534 Mb/s (+4,30%)
WAN to LAN: 539 Mb/s → 549 Mb/s (+1,85%)

**********

2) brcm47xx: BCM4706 SoC

vmlinux.lzma: 1536486 → 1588082 (+3,36%)

a) gro off
LAN to WAN: 152 Mb/s → 157 Mb/s (+3,29%)
WAN to LAN: 191 Mb/s → 182 Mb/s (-4,71%)

b) gro on
LAN to WAN: 223 Mb/s → 226 Mb/s (+1,35%)
WAN to LAN: 214 Mb/s → 214 Mb/s (+0,00%)

**********

3) ramips/mt7621: Ubiquiti ER-X (echo 8 > rps_cpus)

vmlinux size: 6084176 → 6248016 (+2,69%)

a) gro off
LAN to WAN: 415 Mb/s → 418 Mb/s (+0,07%)
WAN to LAN: 509 Mb/s → 543 Mb/s (+6,68%)

b) gro on
LAN to WAN: 640 Mb/s → 537 Mb/s (-16,09%)
WAN to LAN: 748 Mb/s → 683 Mb/s (-8,69%)

c) gro on [another run]
LAN to WAN: 648 Mb/s → 530 Mb/s (-18,20%)
WAN to LAN: 782 Mb/s → 691 Mb/s (-11,64%)

**********

4) ar71xx: Netgear WNR2200 (AR7241)

vmlinux size: 5106084 → 5244996 (+2,72%)

a) gro off
LAN to WAN: 94.1 Mb/s → 94.2 Mb/s (~ +0%)
WAN to LAN: 94.2 Mb/s → 94.2 Mb/s (~ +0%)

b) gro on
LAN to WAN: 94.2 Mb/s → 94.2 Mb/s (~ +0%)
WAN to LAN: 94.1 Mb/s → 94.2 Mb/s (~ +0%)

**********

Signed-off-by: Rafał Miłecki <rafal at milecki.pl>
---
 target/linux/generic/pending-4.14/201-extra_optimization.patch | 2 +-
 target/linux/generic/pending-4.19/201-extra_optimization.patch | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/target/linux/generic/pending-4.14/201-extra_optimization.patch b/target/linux/generic/pending-4.14/201-extra_optimization.patch
index c7790657fd..3f7613d3dd 100644
--- a/target/linux/generic/pending-4.14/201-extra_optimization.patch
+++ b/target/linux/generic/pending-4.14/201-extra_optimization.patch
@@ -26,7 +26,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 +KBUILD_CFLAGS	+= -O2 $(call cc-disable-warning,maybe-uninitialized,) $(EXTRA_OPTIMIZATION)
  else
 -KBUILD_CFLAGS   += -O2
-+KBUILD_CFLAGS   += -O2 -fno-reorder-blocks -fno-tree-ch $(EXTRA_OPTIMIZATION)
++KBUILD_CFLAGS   += -O2 -fno-tree-ch $(EXTRA_OPTIMIZATION)
  endif
  endif
  
diff --git a/target/linux/generic/pending-4.19/201-extra_optimization.patch b/target/linux/generic/pending-4.19/201-extra_optimization.patch
index d86e29fc75..f002c49676 100644
--- a/target/linux/generic/pending-4.19/201-extra_optimization.patch
+++ b/target/linux/generic/pending-4.19/201-extra_optimization.patch
@@ -26,7 +26,7 @@ Signed-off-by: Felix Fietkau <nbd at nbd.name>
 +KBUILD_CFLAGS	+= -O2 $(call cc-disable-warning,maybe-uninitialized,) $(EXTRA_OPTIMIZATION)
  else
 -KBUILD_CFLAGS   += -O2
-+KBUILD_CFLAGS   += -O2 -fno-reorder-blocks -fno-tree-ch $(EXTRA_OPTIMIZATION)
++KBUILD_CFLAGS   += -O2 -fno-tree-ch $(EXTRA_OPTIMIZATION)
  endif
  endif
  
-- 
2.21.0


_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel


More information about the openwrt-devel mailing list