OpenWrt Forum Archive

Topic: Build for WNDR3700/WNDR3800

The content of this topic has been archived between 9 Jul 2013 and 6 May 2018. Unfortunately there are posts – most likely complete pages – missing.

Could just be a memory issue then? How does the memory usage look after an hour or so? Or does the process end soon after boot? On my WNDR37000v2 the sweet spot for memory seems to be about 10% free and then 6relayd would crash. Swap usage doesn't help too much, but you might give it a shot…

I will push an update reducing its heap-memory usage soon. Atm even in server-mode it keeps track of unnecessary things in memory.

CyrusFF wrote:

I see so when a netlink-error message with code ERFKILL is returned then the socket must be restarted?

I guess that mainly refers to the rtnl-socket querying for interface addresses. However I still not see how this could cause a SIGBUS or any illegal memory access leading to one.

I just ran 6relayd on a wifi-interface locally then turned rfkill on and off but valgrind couldn't find anything unusual. Could you maybe elaborate a bit more on your finding?

Thanks a lot

I added code to print the errno, and size returned in the area that it is dying.

I added the 132 errorcode the if statement, and it stayed up..  but no more dgrams came in via the netlink socket.

I plan to play with it more, I have the environment setup now to debug and play more with it.

Here's a snippet from the logs, with verbose turned on in relayd:

Feb 27 13:11:34 192.168.1.253 6relayd[20188]: Received 128 Bytes from kernel%
Feb 27 13:11:34 192.168.1.253 6relayd[20188]: len = 80, errno = 11
Feb 27 13:11:35 192.168.1.253 6relayd[20188]: len = 64, errno = 11
Feb 27 13:11:35 192.168.1.253 6relayd[20188]: --
Feb 27 13:11:35 192.168.1.253 6relayd[20188]: Received 64 Bytes from kernel%
Feb 27 13:11:35 192.168.1.253 6relayd[20188]: len = 128, errno = 11
Feb 27 13:11:35 192.168.1.253 6relayd[20188]: --
Feb 27 13:11:35 192.168.1.253 6relayd[20188]: Received 128 Bytes from kernel%
Feb 27 13:11:36 192.168.1.253 6relayd[20188]: Relayed 136 bytes to ff02::1%br-lan
Feb 27 13:11:37 192.168.1.253 6relayd[20188]: len = 128, errno = 11
Feb 27 13:11:37 192.168.1.253 6relayd[20188]: --
Feb 27 13:11:37 192.168.1.253 6relayd[20188]: Received 128 Bytes from kernel%
Feb 27 13:11:37 192.168.1.253 6relayd[20188]: len = 80, errno = 11
Feb 27 13:11:38 192.168.1.253 6relayd[20188]: len = 64, errno = 11
Feb 27 13:11:38 192.168.1.253 6relayd[20188]: --
Feb 27 13:11:38 192.168.1.253 6relayd[20188]: Received 64 Bytes from kernel%
Feb 27 13:11:38 192.168.1.253 6relayd[20188]: len = 128, errno = 11
Feb 27 13:11:38 192.168.1.253 6relayd[20188]: --
Feb 27 13:11:38 192.168.1.253 6relayd[20188]: Received 128 Bytes from kernel%
Feb 27 13:11:39 192.168.1.253 6relayd[20188]: Relayed 136 bytes to ff02::1%br-lan
Feb 27 13:11:40 192.168.1.253 6relayd[20188]: len = 128, errno = 11
Feb 27 13:11:40 192.168.1.253 6relayd[20188]: --
Feb 27 13:11:40 192.168.1.253 6relayd[20188]: Received 128 Bytes from kernel%
Feb 27 13:11:40 192.168.1.253 6relayd[20188]: len = 128, errno = 11
Feb 27 13:11:40 192.168.1.253 6relayd[20188]: --
Feb 27 13:11:40 192.168.1.253 6relayd[20188]: Received 128 Bytes from kernel%
Feb 27 13:11:40 192.168.1.253 6relayd[20188]: len = 128, errno = 11
Feb 27 13:11:40 192.168.1.253 6relayd[20188]: --
Feb 27 13:11:40 192.168.1.253 6relayd[20188]: Received 128 Bytes from kernel%
Feb 27 13:11:40 192.168.1.253 6relayd[20188]: len = 80, errno = 11
Feb 27 13:11:41 192.168.1.253 6relayd[20188]: len = 64, errno = 11
Feb 27 13:11:41 192.168.1.253 6relayd[20188]: --
Feb 27 13:11:41 192.168.1.253 6relayd[20188]: Received 64 Bytes from kernel%
Feb 27 13:11:41 192.168.1.253 6relayd[20188]: len = -1, errno = 132
Feb 27 13:11:41 192.168.1.253 6relayd[20188]: --
Feb 27 13:11:41 192.168.1.253 6relayd[20188]: Received -1 Bytes from kernel%netlink

So, the dgram with the sizeof -1/errno 132 means the netlink socket had something change in it, and you'll need to close and restart the socket..

OK, I could verify and fix the bug now.
I guess the following happened: errno 132 in this case probably doesn't mean ERFKILL but rather ENOBUFS (as mips has a different name for 132 in arch/mips/include/uapi/asm/errno.h then the ERFKILL in asm-generic/errno.h).
ENOBUFS returned on a recvmsg would make sense in connection with netlink-sockets (not enough buffer space).

I increased the client buffer size: http://nbd.name/gitweb.cgi?p=6relayd.gi … 5bfe3197bc although the error could still appear in low-ram situations (due to the router running out of kernel memory).

However 6relayd wasn't taking care of read-errors on sockets correctly besides EAGAIN / EWOULDBLOCK.
If such an error occured (like ENOBUFS) it is likely an illegal memory access happens.
This should take care of it and avoid the crashes: http://nbd.name/gitweb.cgi?p=6relayd.gi … 9f6dffedd7

I hope that https://dev.openwrt.org/changeset/35836 finally resolves this issue.

Ok, I pulled it down, compiled and started it..  Just a waiting game now.

I have built and uploaded r35836.

24+ hours and IPv6/6relayd has stayed up and running.

So I'd say the problem is fixed.  Thanks!

@hnyman: I recompiled my AA build recently and I can confirm that the kernel compilation stage does not pickup the compile OPTIMIZATION from the .config file. I copied the following line from your .config:

CONFIG_TARGET_OPTIMIZATION="-Os -pipe -march=24kc -mtune=24kc -fno-caller-saves"


During the kernel compile stage, I did a snapshot of the CC commands used and it shows that the entire kernel is compiled using default "mips32r2" CPU optimization instead of what is specified in the configuration file. So I'm pretty sure there's something else that needs to be changed to force the kernel to pickup the "24kc" optimization option.

This is my ps wxa output:

 8931 pts/1    S+     0:00 make -f scripts/Makefile.build obj=arch/mips
 8932 pts/1    S+     0:00 make -f scripts/Makefile.build obj=arch/mips/ath79
 9026 pts/1    S+     0:00 make -f scripts/Makefile.build obj=kernel
 9675 pts/1    S+     0:00 /bin/sh -c set -e; ?   echo '  CC      kernel/extable.o'; mips-openwrt-linux-uclibc-gcc -Wp,-MD,kernel/.extable.o.d  -nostdinc -isystem /home/myopenwrt/openwrt/staging_dir/toolchain-mips_gcc-4.6-linaro_uClibc-0.9.33.2/lib/gcc/mips-openwrt-linux-uclibc/4.6.3/include -I/home/myopenwrt/openwrt/build_dir/linux-ar71xx_generic/linux-3.3.8/arch/mips/include -Iarch/mips/include/generated -Iinclude  -include /home/myopenwrt/openwrt/build_dir/linux-ar71xx_generic/linux-3.3.8/include/linux/kconfig.h -D__KERNEL__ -D"VMLINUX_LOAD_ADDRESS=0xffffffff80060000" -D"DATAOFFSET=0" -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -Os -fno-caller-saves -mno-check-zero-division -mabi=32 -G 0 -mno-abicalls -fno-pic -pipe -msoft-float -ffreestanding -march=mips32r2 -Wa,-mips32r2 -Wa,--trap -I/home/myopenwrt/openwrt/build_dir/linux-ar71xx_generic/linux-3.3.8/arch/mips/include/asm/mach-ath79 -I/home/myopenwrt/openwrt/build_dir/linux-ar71xx_generic/linux-3.3.8/arch/mips/include/asm/mach-generic -Wframe-larger-than=1024 -fno-stack-protector -Wno-unused-but-set-variable -fomit-frame-pointer -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -DCC_HAVE_ASM_GOTO    -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(extable)"  -D"KBUILD_MODNAME=KBUILD_STR(extable)" -c -o kernel/extable.o kernel/extable.c;    scripts/basic/fixdep kernel/.extable.o.d kernel/extable.o 'mips-openwrt-linux-uclibc-gcc -Wp,-MD,kernel/.extable.o.d  -nostdinc -isystem /home/myopenwrt/openwrt/staging_dir/toolchain-mips_gcc-4.6-linaro_uClibc-0.9.33.2/lib/gcc/mips-openwrt-linux-uclibc/4.6.3/include -I/home/myopenwrt/openwrt/build_dir/linux-ar71xx_generic/linux-3.3.8/arch/mips/include -Iarch/mips/include/generated -Iinclude  -include /home/myopenwrt/openwrt/build_dir/linux-ar71xx_generic/linux-3.3.8/include/linux/kconfig.h -D__KERNEL__ -D"VMLINUX_LOAD_ADDRESS=0xffffffff80060000" -D"DATAOFFSET=0" -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -Os -fno-caller-saves -mno-check-zero-division -mabi=32 -G 0 -mno-abicalls -fno-pic -pipe -msoft-float -ffreestanding -march=mips32r2 -Wa,-mips32r2 -Wa,--trap -I/home/myopenwrt/openwrt/build_dir/linux-ar71xx_generic/linux-3.3.8/arch/mips/include/asm/mach-ath79 -I/home/myopenwrt/openwrt/build_dir/linux-ar71xx_generic/linux-3.3.8/arch/mips/include/asm/mach-generic -Wframe-larger-than=1024 -fno-stack-protector -Wno-unused-but-set-variable -fomit-frame-pointer -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -DCC_HAVE_ASM_GOTO    -D"KBUILD_STR(s)=\#s" -D"KBUILD_BASENAME=KBUILD_STR(extable)"  -D"KBUILD_MODNAME=KBUILD_STR(extable)" -c -o kernel/extable.o kernel/extable.c' > kernel/.extable.o.tmp; rm -f kernel/.extable.o.d; mv -f kernel/.extable.o.tmp kernel/.extable.o.cmd
 9676 pts/1    S+     0:00 mips-openwrt-linux-uclibc-gcc -Wp,-MD,kernel/.extable.o.d -nostdinc -isystem /home/myopenwrt/openwrt/staging_dir/toolchain-mips_gcc-4.6-linaro_uClibc-0.9.33.2/lib/gcc/mips-openwrt-linux-uclibc/4.6.3/include -I/home/myopenwrt/openwrt/build_dir/linux-ar71xx_generic/linux-3.3.8/arch/mips/include -Iarch/mips/include/generated -Iinclude -include /home/myopenwrt/openwrt/build_dir/linux-ar71xx_generic/linux-3.3.8/include/linux/kconfig.h -D__KERNEL__ -DVMLINUX_LOAD_ADDRESS=0xffffffff80060000 -DDATAOFFSET=0 -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -Os -fno-caller-saves -mno-check-zero-division -mabi=32 -G 0 -mno-abicalls -fno-pic -pipe -msoft-float -ffreestanding -march=mips32r2 -Wa,-mips32r2 -Wa,--trap -I/home/myopenwrt/openwrt/build_dir/linux-ar71xx_generic/linux-3.3.8/arch/mips/include/asm/mach-ath79 -I/home/myopenwrt/openwrt/build_dir/linux-ar71xx_generic/linux-3.3.8/arch/mips/include/asm/mach-generic -Wframe-larger-than=1024 -fno-stack-protector -Wno-unused-but-set-variable -fomit-frame-pointer -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -DCC_HAVE_ASM_GOTO -DKBUILD_STR(s)=#s -DKBUILD_BASENAME=KBUILD_STR(extable) -DKBUILD_MODNAME=KBUILD_STR(extable) -c -o kernel/extable.o kernel/extable.c
 9677 pts/1    R+     0:00 /home/myopenwrt/openwrt/staging_dir/toolchain-mips_gcc-4.6-linaro_uClibc-0.9.33.2/libexec/gcc/mips-openwrt-linux-uclibc/4.6.3/cc1 -quiet -nostdinc -I /home/myopenwrt/openwrt/build_dir/linux-ar71xx_generic/linux-3.3.8/arch/mips/include -I arch/mips/include/generated -I include -I /home/myopenwrt/openwrt/build_dir/linux-ar71xx_generic/linux-3.3.8/arch/mips/include/asm/mach-ath79 -I /home/myopenwrt/openwrt/build_dir/linux-ar71xx_generic/linux-3.3.8/arch/mips/include/asm/mach-generic -idirafter /home/myopenwrt/openwrt/staging_dir/target-mips_uClibc-0.9.33.2/usr/include -D __KERNEL__ -D VMLINUX_LOAD_ADDRESS=0xffffffff80060000 -D DATAOFFSET=0 -D CC_HAVE_ASM_GOTO -D KBUILD_STR(s)=#s -D KBUILD_BASENAME=KBUILD_STR(extable) -D KBUILD_MODNAME=KBUILD_STR(extable) -isystem /home/myopenwrt/openwrt/staging_dir/toolchain-mips_gcc-4.6-linaro_uClibc-0.9.33.2/lib/gcc/mips-openwrt-linux-uclibc/4.6.3/include -include /home/myopenwrt/openwrt/build_dir/linux-ar71xx_generic/linux-3.3.8/include/linux/kconfig.h -MD kernel/.extable.o.d kernel/extable.c -G 0 -quiet -dumpbase extable.c -mno-check-zero-division -mabi=32 -mno-abicalls -msoft-float -march=mips32r2 -mllsc -mplt -mno-synci -mno-shared -auxbase-strip kernel/extable.o -Os -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -Werror=implicit-function-declaration -Wno-format-security -Wframe-larger-than=1024 -Wno-unused-but-set-variable -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-aliasing -fno-common -fno-delete-null-pointer-checks -fno-caller-saves -fno-pic -ffreestanding -fno-stack-protector -fomit-frame-pointer -fno-strict-overflow -fconserve-stack -o -
 9678 pts/1    S+     0:00 /home/myopenwrt/openwrt/staging_dir/toolchain-mips_gcc-4.6-linaro_uClibc-0.9.33.2/lib/gcc/mips-openwrt-linux-uclibc/4.6.3/../../../../mips-openwrt-linux-uclibc/bin/as -G 0 -EB -no-mdebug -mabi=32 -march=mips32r2 -mno-shared -mips32r2 --trap -o kernel/extable.o

Feel free to analyze it and try to figure out a better method.

As we discussed in November, I quickly analysed the build log then and it seemed that majority of the compiler commands were correct.
https://forum.openwrt.org/viewtopic.php … 89#p184489

hnyman wrote:

build log contained 32505 lines, of which 4637 contained the "-march" option.
Of these, 4631 lines had "24kc" and only 6 lines had "mips32r2".


Did you start from empty .config recipe? (Or from a full .config?)
And did you have all three lines?
CONFIG_DEVEL=y
CONFIG_TARGET_OPTIONS=y
CONFIG_TARGET_OPTIMIZATION="-Os -pipe -march=24kc -mtune=24kc -fno-caller-saves -mno-branch-likely"

hnyman wrote:

Feel free to analyze it and try to figure out a better method.

As we discussed in November, I quickly analysed the build log then and it seemed that majority of the compiler commands were correct.
https://forum.openwrt.org/viewtopic.php … 89#p184489

Yes, I recall we discussed this. If there's nothing confidential in your build logs, will you be able to share them with your AA binary files in the same folder? What I noticed is that the STDOUT from "make -j 3 V=s" is very verbose on the compiler flags for everything else except kernel.

The output for kernel kernel compiler is simply "CC  <path>/<component>.o". The only way that I could see the flags used for kernel is via "ps" during kernel compile phase. The closest Makefile with the matching flags that I saw was in "target/linux/ar71xx/image/lzma-loader/src/Makefile". Modifying the options didn't make a difference. I'm still looking through various Makefiles.

hnyman wrote:

Did you start from empty .config recipe? (Or from a full .config?)
And did you have all three lines?
CONFIG_DEVEL=y
CONFIG_TARGET_OPTIONS=y
CONFIG_TARGET_OPTIMIZATION="-Os -pipe -march=24kc -mtune=24kc -fno-caller-saves -mno-branch-likely"

I tried both, empty .config and my own .config. I've also ensured that all 3 lines above are in there. The optimization are applied to everything else except kernel. If you could share your build log or share pointers on how to enable verbose STDOUT for kernel compile phase, it maybe be helpful.


Edit: This is a snippet prefix of the kernel compiler command. Notice that the echo command shows only the module name that's being compiled, while the rest of the gcc options are omitted? This is probably why I didn't see anything when STDOUT was logged.

/bin/sh -c set -e; ?   echo '  CC [M]  fs/fat/inode.o'; mips-openwrt-linux-uclibc-gcc -Wp,-MD,fs/fat/.inode.o.d  -nostdinc -isystem /home/myopenwrt/openwrt/staging_dir/toolchain-mips_gcc-4.6-linaro_uClibc-0.9.33.2/lib/gcc/mips-openwrt-linux-uclibc/4.6.3/include -I/home/myopenwrt/openwrt/build_dir/linux-ar71xx_generic/linux-3.3.8/arch/mips/include -Iarch/mips/include/generated -Iinclude  -include /home/myopenwrt/openwrt/build_dir/linux-ar71xx_generic/linux-3.3.8/include/linux/kconfig.h -D__KERNEL__ -D"VMLINUX_LOAD_ADDRESS=0xffffffff80060000" -D"DATAOFFSET=0" -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -Os -fno-caller-saves -mno-check-zero-division -mabi=32 -G 0 -mno-abicalls -fno-pic -pipe -msoft-float -ffreestanding -march=mips32r2 -Wa,-mips32r2 ....(snip)

(Last edited by phuque99 on 5 Mar 2013, 15:03)

FYI, if you upgrade to kernel 3.8, you need to add the following to then end of your mount.cifs commands ,sec=ntlm

johnthomas00 wrote:

FYI, if you upgrade to kernel 3.8, you need to add the following to then end of your mount.cifs commands ,sec=ntlm

Thanks for the headsup. Looks like you are right.

This seems to work for me (one command line, despite the forum's formatting):

mount -t cifs //192.168.1.111/ftp-nas /mnt -o username=user,password=passwd,sec=ntlm,file_mode=0644,unc=\\\\192.168.1.111\\ftp-nas
phuque99 wrote:

During the kernel compile stage, I did a snapshot of the CC commands used and it shows that the entire kernel is compiled using default "mips32r2" CPU optimization instead of what is specified in the configuration file.

Closing the loop on this. I confirmed that kernel compiler uses the flags in "build_dir/linux-ar71xx_generic/linux-3.3.8/arch/mips/Makefile". Those are the Linux kernel MIPS32 defaults. That file is wiped and created again from the kernel source each time a build is initiated. So there's no way to change that except through a compile-time patch.

Did you test changing target/linux/ar71xx/Makefile directly?

It might be that kernel compilation picks the string from there, so that the other override is overlooked.
Or do you think that the kernel options comes directly from inside the linux source distribution?

(Last edited by hnyman on 6 Mar 2013, 10:16)

hnyman wrote:

Did you test changing /trunk/target/linux/ar71xx/Makefile directly?

It might be that kernel compilation picks the string from there, so that the other override is overlooked.
Or do you think that the kernel options comes directly from inside the linux source distribution?

I changed that and I also "target/linux/ar71xx/image/lzma-loader/src/Makefile". I ran the following to scour the entire build_dir for instances of compiler optimization too:

"for FILE in $(find -type f ); do grep -H "mips32r2" $FILE; done"

I'm pretty sure now that the kernel cflags come from Linux, not OpenWRT makefiles. Our own build.logs didn't catch this because because the Linux compiler output is suppressed.

hnyman wrote:

Then it probably comes from here:
https://git.kernel.org/cgit/linux/kerne … s/Makefile

Correct. The following patch file will modify the Makefile during the build process for ar71xx targets. Saved it as "target/linux/ar71xx/patches-3.3/999-kernel_makefile.patch"

--- a/arch/mips/Makefile    2013-03-06 09:54:18.825913173 +0100
+++ b/arch/mips/Makefile    2013-03-06 09:55:30.441916721 +0100
@@ -130,8 +130,8 @@
 cflags-$(CONFIG_CPU_TX49XX)    += -march=r4600 -Wa,--trap
 cflags-$(CONFIG_CPU_MIPS32_R1)    += $(call cc-option,-march=mips32,-mips32 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS32) \
             -Wa,-mips32 -Wa,--trap
-cflags-$(CONFIG_CPU_MIPS32_R2)    += $(call cc-option,-march=mips32r2,-mips32r2 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS32) \
-            -Wa,-mips32r2 -Wa,--trap
+cflags-$(CONFIG_CPU_MIPS32_R2)    += $(call cc-option,-march=24kc,-mtune=24kc -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS32) \
+            -Wa,-march=24kc -mtune=24kc -Wa,--trap
 cflags-$(CONFIG_CPU_MIPS64_R1)    += $(call cc-option,-march=mips64,-mips64 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS64) \
             -Wa,-mips64 -Wa,--trap
 cflags-$(CONFIG_CPU_MIPS64_R2)    += $(call cc-option,-march=mips64r2,-mips64r2 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS64) \

Warning:
1. This optimizes for MIPS CPU 24kc only, so it'll work for WNDR3700 / 3800. Don't try if you're not sure what you're doing.
2. I've not done any full QA tests so I'm not sure if it will also break anything else. Nothing's broken so far for me.

That being said, if anyone plans to run benchmark, do share your result. I'll run some openssl tests following the old thread on compiler optimization when I get some time to work this into my spare router.

phuque99, interesting, thank you.  I am willing to test, but your patch does not apply to 3.8.  I am afraid that I do not know enough to conform your patch to 3.8.

Hunk #1 FAILED at 130.
1 out of 1 hunk FAILED -- rejects in file arch/mips/Makefile
Patch platform/999-kerneltune.patch does not apply (enforce with -f)

I believe that the corresponding 3.8.2 change would be:

@@ -137,8 +137,8 @@
 cflags-$(CONFIG_CPU_TX49XX)    += -march=r4600 -Wa,--trap
 cflags-$(CONFIG_CPU_MIPS32_R1)    += $(call cc-option,-march=mips32,-mips32 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS32) \
             -Wa,-mips32 -Wa,--trap
-cflags-$(CONFIG_CPU_MIPS32_R2)    += $(call cc-option,-march=mips32r2,-mips32r2 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS32) \
-            -Wa,-mips32r2 -Wa,--trap
+cflags-$(CONFIG_CPU_MIPS32_R2)    += $(call cc-option,-march=24kc,-mtune=24kc -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS32) \
+            -Wa,-march=24kc -mtune=24kc -Wa,--trap
 cflags-$(CONFIG_CPU_MIPS64_R1)    += $(call cc-option,-march=mips64,-mips64 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS64) \
             -Wa,-mips64 -Wa,--trap
 cflags-$(CONFIG_CPU_MIPS64_R2)    += $(call cc-option,-march=mips64r2,-mips64r2 -U_MIPS_ISA -D_MIPS_ISA=_MIPS_ISA_MIPS64) \

Argh. the forum shows some of the "option -" as "change -"...
Trying to quote reply my message enables you to copy the correct change from the editor.

I am not going to try that by myself, yet, but if it seems to succeed for you, then maybe later.

(Last edited by hnyman on 6 Mar 2013, 21:11)

I must be doing something wrong.
I download your kerneloptimization.patch, rename it 999-kerneloptimization.patch, mv it to /Openwrt/trunk/target/linux/ar71xx/patches-3.8, then build inlcuding a dirclean, which results in the following:

make[1]: Entering directory `/Openwrt/trunk'
make[2]: Entering directory `/Openwrt/trunk'
rm -rf /Openwrt/trunk/staging_dir/target-mips_uClibc-0.9.33.2/root-ar71xx
make[2]: Leaving directory `/Openwrt/trunk'
make[2]: Entering directory `/Openwrt/trunk'
make[3]: Entering directory `/Openwrt/trunk/target/linux'
make[4]: Entering directory `/Openwrt/trunk/target/linux/ar71xx'
if [ -s "/Openwrt/trunk/build_dir/target-mips_uClibc-0.9.33.2/linux-ar71xx_generic/linux-3.8.2/patches/series" ]; then (cd "/Openwrt/trunk/build_dir/target-mips_uClibc-0.9.33.2/linux-ar71xx_generic/linux-3.8.2"; if quilt --quiltrc=- next >/dev/null 2>&1; then quilt --quiltrc=- push -a; else quilt --quiltrc=- top >/dev/null 2>&1; fi ); fi
Applying patch platform/999-kerneloptimization.patch
patching file arch/mips/Makefile
Hunk #1 FAILED at 137.
1 out of 1 hunk FAILED -- rejects in file arch/mips/Makefile
Patch platform/999-kerneloptimization.patch does not apply (enforce with -f)
make[4]: *** [/Openwrt/trunk/build_dir/target-mips_uClibc-0.9.33.2/linux-ar71xx_generic/linux-3.8.2/.quilt_checked] Error 1
make[4]: Leaving directory `/Openwrt/trunk/target/linux/ar71xx'
make[3]: *** [compile] Error 2
make[3]: Leaving directory `/Openwrt/trunk/target/linux'
make[2]: *** [target/linux/compile] Error 2
make[2]: Leaving directory `/Openwrt/trunk'
make[1]: *** [/Openwrt/trunk/staging_dir/target-mips_uClibc-0.9.33.2/stamp/.target_compile] Error 2
make[1]: Leaving directory `/Openwrt/trunk'
make: *** [world] Error 2

Try again: http://koti.welho.com/hnyman1/Openwrt/9 … tion.patch

I made this patch the hard way, patching the Makefile in buildroot and then tested it with
make target/linux/clean
make target/linux/prepare

No errors.

Apparently the version timestamps in the first patch were too much or something like that.

(Last edited by hnyman on 6 Mar 2013, 21:16)

I ended up compiling the "kernel optimized" version and flashed it to my old 3700v1. Currently testing it under load.


As I expected, changing the kernel parameters did not affect Openssl benchmark results:

WNDR3800 kernel 3.8.2 "normal optimization" 24kc
| 1.0.1e |  36850210 |  23677770 |  11112130 |  4910750 |  5265890 |  1885810 |  8725160 |  7577260 |  6611290 |  8.1 |  281.3 |  28.1 |  23.1 |
| 1.0.1e |  36448260 |  24309760 |  10975910 |  4934160 |  5250050 |  1881210 |  8734040 |  7581040 |  6610260 |  8.1 |  280.8 |  28.1 |  22.9 |

WNDR3700v1 kernel 3.8.2 "normal optimization" 24kc
| 1.0.1e |  36367410 |  23739790 |  11034460 |  4934160 |  5284810 |  1883750 |  8773410 |  7637650 |  6603780 |  8.1 |  280.0 |  28.1 |  22.6 |
| 1.0.1e |  36791840 |  23375470 |  11000980 |  4901710 |  5254940 |  1884850 |  8803990 |  7518640 |  6646380 |  8.1 |  278.5 |  28.1 |  23.2 |

WNDR3700v1 kernel 3.8.2 "normal optimization" 24kc + kernel optimization
| 1.0.1e |  36733670 |  23671290 |  11099680 |  4912450 |  5271880 |  1889750 |  8769980 |  7581740 |  6620730 |  8.1 |  281.3 |  28.2 |  22.9 |
| 1.0.1e |  36758630 |  23446530 |  11020370 |  4896020 |  5255280 |  1881690 |  8893820 |  7560420 |  6658760 |  8.1 |  281.9 |  28.1 |  23.1 |

Anybody have good ideas, how to test kernel (real-life) performance?

My intuition is that this does not produce material benefits, as most of the kernel operations are not that mathematically intensive.

(Last edited by hnyman on 15 Mar 2013, 22:29)

Built and works for me.  Will follow up if I run into any issues.

Sorry, posts 476 to 475 are missing from our archive.