OpenWrt Forum Archive

Topic: Update on Linksys WRT1900AC support

The content of this topic has been archived between 16 Sep 2014 and 7 May 2018. Unfortunately there are posts – most likely complete pages – missing.

alirz wrote:

Has there not been any progress in fixing the router freeze due to "cpu stall"

The latest wifi drivers, available for download, address one of the two freezing issues (my understanding from memory).

Since RC3 and the latest wifi drivers, I've had Zero (0) freezes or cpu stalls.

Though we have one or two who might disagree, I feel running a static type of cpu-affinity helps to keep the cpu stall monster away. I have posted a script that when the router boots will automatically put 2.4Ghz and 5Ghz wifi on different CPU's as well as WAN port and the 4 eithernet ports. It's been documented that out of the box install of OpenWrt, only uses 1 cpu core for both wifi channels as well as WAN and Ethernet ports. With default configuration, CPU Core 0 becomes 100% utilized very quickly, so if you balance the load between 2 cpu's, it helps performance, buy my estimation 10%-20%.

(Last edited by davidc502 on 14 Aug 2015, 20:57)

sucka wrote:

Would using a wrt1200ac be even better ? as this is mostly to be in stock where i live.

I don't know what router to pick for features and as asuswrt is a joke only option to have features is using openwrt (even though years ago when i used it i was loosing day and nights playing with it and not having internet) so wrt1200/1900 seems to be the best bet for fastest hardware for openwrt and fully functional.

Thank you again people! smile

the wrt1200ac is a 2x2 radio while the wrt1900ac is a 3x3 radio, you will only get ~2/3 the wifi performance on a 1200 as on a 1900 just from the radio limitations. If you are trying to saturate a gig uplink, even a 3x3 is going to have trouble.

A 3x3 radio can process data at up to 1.3Gb/s data rate, but it's half duplex (where your uplink is 1Gb/s each way for a total of 2Gb of bandwidth) and there are many other things that eat up transmission time that subtract from the advertised 1.3Gb/s rate

I am not sure how many WRT1900AC v1 users are still waiting for dd-wrt but Kong posted his build on his PTB page a couple of days ago.

http://www.desipro.de/ddwrt/WRT1900ACV1/

So I guess its open season for the WRT1900AC v1.
At least until BS gets it fully integrated into his main release betas.

sucka wrote:

So the problem still exists even in this router, damn companies that don't give all the sources and they even proudly lie "opensource ready" to be so would mean to give everything needed so the open source to work at least at the stock performance even if they know that the opensource will become faster than stock, it's like they don't want to sell.

I am returning now a rt-ac87u and dont know what to choose what will be best suported for future wrt1200ac or netgear r7500 that even has a 1.4ghz cpu even for non accelerated nat should be better. But r7500 cant find good source if supported by openwrt.

As I understand it, there are no 802.11ac routers that have fully open drivers.

The 1200/1900 drivers are as open as anything, more open than most, and with the vendor saying "opensource ready" there is actual participation from the vendor in making it work for OpenWRT.

They botched the 1900 entirely, no disagreement there, but my understanding is that they have been funding work on the 1200 since before it's release.

the difference in performance between a 1.2, 1.3, or 1.4Ghz cpu is going to be rather small. A large part of your bottleneck is going to be in moving the packet data across the bus, the CPU is going to be largely idle even at full speed.

dlang wrote:
sucka wrote:

So the problem still exists even in this router, damn companies that don't give all the sources and they even proudly lie "opensource ready" to be so would mean to give everything needed so the open source to work at least at the stock performance even if they know that the opensource will become faster than stock, it's like they don't want to sell.

I am returning now a rt-ac87u and dont know what to choose what will be best suported for future wrt1200ac or netgear r7500 that even has a 1.4ghz cpu even for non accelerated nat should be better. But r7500 cant find good source if supported by openwrt.


the difference in performance between a 1.2, 1.3, or 1.4Ghz cpu is going to be rather small. A large part of your bottleneck is going to be in moving the packet data across the bus, the CPU is going to be largely idle even at full speed.

Would agree, 200 or 400mhz isn't going to be a end all reason to go with a different router.

Same thing with v1 vs. v2 1900ac... People have been coming up with excuses to send back a v1 router for v2 because they think it's going to be some huge difference. The bottom line is both have the same performance specs (Wifi 1900 and 1Gig Ethernet). Really the only reason to go with v2 would be if v2 was more stable than v1.

davidc502 wrote:
alirz wrote:

Has there not been any progress in fixing the router freeze due to "cpu stall"

The latest wifi drivers, available for download, address one of the two freezing issues (my understanding from memory).

Since RC3 and the latest wifi drivers, I've had Zero (0) freezes or cpu stalls.

Though we have one or two who might disagree, I feel running a static type of cpu-affinity helps to keep the cpu stall monster away. I have posted a script that when the router boots will automatically put 2.4Ghz and 5Ghz wifi on different CPU's as well as WAN port and the 4 eithernet ports. It's been documented that out of the box install of OpenWrt, only uses 1 cpu core for both wifi channels as well as WAN and Ethernet ports. With default configuration, CPU Core 0 becomes 100% utilized very quickly, so if you balance the load between 2 cpu's, it helps performance, buy my estimation 10%-20%.

I am running the new wifi driver from about 2-3 weeks ago. Router froze yesterday .. I will look into this script you mention. i.e if i can find it smile

@davidc502

Which one do i use?

--------------------------------------------------------
#!/bin/sh
echo 1 >/proc/irq/27/smp_affinity
echo 2 >/proc/irq/28/smp_affinity
echo 1 >/proc/irq/88/smp_affinity
echo 2 >/proc/irq/89/smp_affinity
--------------------------------------------------------

OR

--------------------------------------------------------
#!/bin/sh
# buy time otherwise files are written over during boot
ping 192.168.1.1 -c 6
# split wifi and ethernet on two different processors
echo 2 > /proc/irq/87/smp_affinity
echo 2 > /proc/irq/27/smp_affinity
--------------------------------------------------------

alirz wrote:
davidc502 wrote:
alirz wrote:

Has there not been any progress in fixing the router freeze due to "cpu stall"

The latest wifi drivers, available for download, address one of the two freezing issues (my understanding from memory).

Since RC3 and the latest wifi drivers, I've had Zero (0) freezes or cpu stalls.

Though we have one or two who might disagree, I feel running a static type of cpu-affinity helps to keep the cpu stall monster away. I have posted a script that when the router boots will automatically put 2.4Ghz and 5Ghz wifi on different CPU's as well as WAN port and the 4 eithernet ports. It's been documented that out of the box install of OpenWrt, only uses 1 cpu core for both wifi channels as well as WAN and Ethernet ports. With default configuration, CPU Core 0 becomes 100% utilized very quickly, so if you balance the load between 2 cpu's, it helps performance, buy my estimation 10%-20%.

I am running the new wifi driver from about 2-3 weeks ago. Router froze yesterday .. I will look into this script you mention. i.e if i can find it smile

#!/bin/sh


TailResult=`tail -n 190 /mnt/sdb1/syslog | grep 'rcu_sched self-detected stall on CPU { 0}'`
    if [ "$TailResult" != "" ] ;then
    echo b > /proc/sysrq-trigger &
    fi

gufus wrote:
alirz wrote:
davidc502 wrote:

The latest wifi drivers, available for download, address one of the two freezing issues (my understanding from memory).

Since RC3 and the latest wifi drivers, I've had Zero (0) freezes or cpu stalls.

Though we have one or two who might disagree, I feel running a static type of cpu-affinity helps to keep the cpu stall monster away. I have posted a script that when the router boots will automatically put 2.4Ghz and 5Ghz wifi on different CPU's as well as WAN port and the 4 eithernet ports. It's been documented that out of the box install of OpenWrt, only uses 1 cpu core for both wifi channels as well as WAN and Ethernet ports. With default configuration, CPU Core 0 becomes 100% utilized very quickly, so if you balance the load between 2 cpu's, it helps performance, buy my estimation 10%-20%.

I am running the new wifi driver from about 2-3 weeks ago. Router froze yesterday .. I will look into this script you mention. i.e if i can find it smile

#!/bin/sh


TailResult=`tail -n 190 /mnt/sdb1/syslog | grep 'rcu_sched self-detected stall on CPU { 0}'`
    if [ "$TailResult" != "" ] ;then
    echo b > /proc/sysrq-trigger &
    fi

i think thats a logging script. Davidc502 was talking about a script to balance irqs among the two cpu cores if i understood correctly.

alirz wrote:
gufus wrote:
alirz wrote:

I am running the new wifi driver from about 2-3 weeks ago. Router froze yesterday .. I will look into this script you mention. i.e if i can find it smile

#!/bin/sh


TailResult=`tail -n 190 /mnt/sdb1/syslog | grep 'rcu_sched self-detected stall on CPU { 0}'`
    if [ "$TailResult" != "" ] ;then
    echo b > /proc/sysrq-trigger &
    fi

i think thats a logging script. Davidc502 was talking about a script to balance irqs among the two cpu cores if i understood correctly.

Nope, it's not a  logging script

echo b > /proc/sysrq-trigger &

emergency reboot or shutdown with magic commands

https://major.io/2009/01/29/linux-emerg … -commands/

(Last edited by gufus on 14 Aug 2015, 23:56)

Automatic fan control

RC3 - Mamba
Runs as a daemon, MUCH FASTER than a cron job

start/stop

/etc/init.d/fan_control start
/etc/init.d/fan_control stop

fan_control

#!/bin/sh /etc/rc.common

# put in /etc/init.d/fan_control

START=99

PIDFILE=/var/run/fan_monitor_pid

start() {
    start-stop-daemon -b -S -x /usr/sbin/fan_monitor -m -p $PIDFILE
}

stop() {
    start-stop-daemon -K -p $PIDFILE
}

fan_monitor

#!/bin/sh

# put in /usr/sbin/fan_monitor
# fan_monitor
# Utility script to monitor temperatures and turn on/off/run the fan in accordance
# with the original Belkin specs.

INTERVAL=5 # Poll every 5 seconds

# The fan will turn on if any of these temperatures is exceeded
CPU_ON=60000    # Belkin default is 85
DDR_ON=60000    # Belkin default is 65
WIFI_ON=65000   # Belkin default is 105

# The fan will run at reduced speed if any of these temperatures are below these values
CPU_MID=55000     # Belkin sets no default
DDR_MID=55000     # Belkin sets no default
WIFI_MID=60000    # Belkin sets no default

# The fan will turn off if all of the temperatures are below these values
CPU_OFF=50000     # Belkin default is 80
DDR_OFF=50000     # Belkin default is 60
WIFI_OFF=55000    # Belkin default is 100

old_pwm=-1

fan_set() {
    if [ "$1" -eq 2 ]; then
        pwm=255
    elif [ "$1" -eq 1 ]; then
        pwm=128
    elif [ "$1" -eq 0 ]; then
        pwm=0
    fi
    if [ "$pwm" -ne "$old_pwm" ]; then
        echo "Setting fan PWM to: $pwm"
        echo "$pwm" > /sys/devices/pwm_fan/hwmon/hwmon0/pwm1
        old_pwm=$pwm
    fi
}

# Turn fan to reduced speed when exiting
trap "{ fan_set 1; exit; }" SIGINT SIGTERM

# Main fan control loop
while :
do
    cpu=`cat /sys/class/hwmon/hwmon2/temp1_input`
    ddr=`cat /sys/class/hwmon/hwmon1/temp1_input`
    wifi=`cat /sys/class/hwmon/hwmon1/temp2_input`

    if [ "$cpu" -ge $CPU_ON -o "$ddr" -ge $DDR_ON -o "$wifi" -ge $WIFI_ON ]
    then
        fan_set 2
    elif [ "$cpu" -le $CPU_OFF -a "$ddr" -le $DDR_OFF -a "$wifi" -le $WIFI_OFF ]
    then
        fan_set 0
    elif [ "$cpu" -le $CPU_MID -a "$ddr" -le $DDR_MID -a "$wifi" -le $WIFI_MID ]
    then
        fan_set 1
    fi

    sleep $INTERVAL
done

(Last edited by gufus on 15 Aug 2015, 02:39)

alirz wrote:

@davidc502

Which one do i use?

--------------------------------------------------------
#!/bin/sh
echo 1 >/proc/irq/27/smp_affinity
echo 2 >/proc/irq/28/smp_affinity
echo 1 >/proc/irq/88/smp_affinity
echo 2 >/proc/irq/89/smp_affinity
--------------------------------------------------------

OR

--------------------------------------------------------
#!/bin/sh
# buy time otherwise files are written over during boot
ping 192.168.1.1 -c 6
# split wifi and ethernet on two different processors
echo 2 > /proc/irq/87/smp_affinity
echo 2 > /proc/irq/27/smp_affinity
--------------------------------------------------------

I'm back from work...

Set  /etc/rc.local  to point to script in root.

# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.
#cpu script to change affinitiy
/root/affinity.sh
exit 0


I put the following script in root.


#!/bin/sh
# buy time otherwise files are written over during boot
ping 192.168.1.1 -c 6
# split wifi and ethernet on two different processors
echo 2 > /proc/irq/87/smp_affinity
echo 2 > /proc/irq/27/smp_affinity

(Last edited by davidc502 on 15 Aug 2015, 00:51)

how would i go about putting 5GHZ wifi and ethernet on 1 cpu and 2.4GHZ wifi on the other cpu?

Also, currently all interrupts have 3 in the affinity file. What does 3 mean

root@OpenWrt:/proc/irq# cat */smp_affinity
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3
3

(Last edited by alirz on 15 Aug 2015, 01:12)

alirz wrote:

how would i go about putting 5GHZ wifi and ethernet on 1 cpu and 2.4GHZ wifi on the other cpu?

Also, currently all interrupts have 3 in the affinity file. What does 3 mean

root@OpenWrt:/proc/irq# cat */smp_affinity
3

I believe that it's a bitmask, so 3 is binary 11 or enabled on both cpus

gufus wrote:

TailResult=`tail -n 190 /mnt/sdb1/syslog | grep 'rcu_sched self-detected stall on CPU { 0}'`
    if [ "$TailResult" != "" ] ;then
    echo b > /proc/sysrq-trigger &
    fi

Hey, that looks familiar ... but I would say, if you are not logging anything to syslog etc (like I am), you should use quagga's, that is MUCH leaner!

logread -f|grep -qi 'rcu_sched self-detected stall' && echo b > /proc/sysrq-trigger &

PS:  curl, anybody, Bulier ....

(Last edited by IvanRaide on 15 Aug 2015, 02:29)

IvanRaide wrote:
gufus wrote:

TailResult=`tail -n 190 /mnt/sdb1/syslog | grep 'rcu_sched self-detected stall on CPU { 0}'`
    if [ "$TailResult" != "" ] ;then
    echo b > /proc/sysrq-trigger &
    fi

Hey, that looks familiar ... but I would say, if you are not logging anything to syslog etc (like I am), you should use quagga, that is MUCH leaner!

'k

smile

gufus wrote:

Automatic fan control

# The fan will turn on if any of these temperatures is exceeded
CPU_ON=60000    # Belkin default is 85
DDR_ON=60000    # Belkin default is 65
WIFI_ON=65000   # Belkin default is 105

# The fan will turn off if all of the temperatures are below these values
CPU_OFF=50000     # Belkin default is 80
DDR_OFF=50000     # Belkin default is 60
WIFI_OFF=55000    # Belkin default is 100

are these temps C or F?
couse if C these thing looks build to last ... not so much lol

dlang wrote:
alirz wrote:

how would i go about putting 5GHZ wifi and ethernet on 1 cpu and 2.4GHZ wifi on the other cpu?

Also, currently all interrupts have 3 in the affinity file. What does 3 mean

root@OpenWrt:/proc/irq# cat */smp_affinity
3

I believe that it's a bitmask, so 3 is binary 11 or enabled on both cpus

Supposedly enabled, but only uses 1 core.

makarel wrote:
gufus wrote:

Automatic fan control

# The fan will turn on if any of these temperatures is exceeded
CPU_ON=60000    # Belkin default is 85
DDR_ON=60000    # Belkin default is 65
WIFI_ON=65000   # Belkin default is 105

# The fan will turn off if all of the temperatures are below these values
CPU_OFF=50000     # Belkin default is 80
DDR_OFF=50000     # Belkin default is 60
WIFI_OFF=55000    # Belkin default is 100

are these temps C or F?
couse if C these thing looks build to last ... not so much lol

C

/etc/usr/bin$ cat /sys/class/hwmon/hwmon2/temp1_input
53019

/etc/usr/bin$ sensors

tmp421-i2c-0-4c
Adapter: mv64xxx_i2c adapter
temp1:        +42.4 C 
temp2:        +46.6 C 

armada_thermal-virtual-0
Adapter: Virtual device
temp1:        +51.6 C

davidc502 wrote:
dlang wrote:
alirz wrote:

how would i go about putting 5GHZ wifi and ethernet on 1 cpu and 2.4GHZ wifi on the other cpu?

Also, currently all interrupts have 3 in the affinity file. What does 3 mean

root@OpenWrt:/proc/irq# cat */smp_affinity
3

I believe that it's a bitmask, so 3 is binary 11 or enabled on both cpus

Supposedly enabled, but only uses 1 core.

The driver may only be able to use one thread to talk to both radios. It's not unusual for a driver to be this sort of bottleneck. If so, enabling both cpus doesn't mean it will use both at once, but rather that it will move from one to the other if there is enough other stuff running on the same core it's trying to use to be a problem.

There's a cost in moving from core to core (cache related) so the system is much more reluctant to move things than it used to be.

dlang wrote:
davidc502 wrote:
dlang wrote:

I believe that it's a bitmask, so 3 is binary 11 or enabled on both cpus

Supposedly enabled, but only uses 1 core.

The driver may only be able to use one thread to talk to both radios. It's not unusual for a driver to be this sort of bottleneck. If so, enabling both cpus doesn't mean it will use both at once, but rather that it will move from one to the other if there is enough other stuff running on the same core it's trying to use to be a problem.

There's a cost in moving from core to core (cache related) so the system is much more reluctant to move things than it used to be.

The problem I've observed is Wifi and Ethernet will run on 1 core and never move off of that core. I have seen several programs like OpenVPN switch cores, but never ethernet or Wifi.

So, splitting them up makes a lot of sense from a bottleneck standpoint... But besides that, since splitting them up, before RC3 and the new drivers I had far fewer router freezing... and since RC3 and wifi drivers I've had zero 0.

(Last edited by davidc502 on 15 Aug 2015, 04:35)

Momentarily giving up on 'curl', I figured I would setup something to email me if the router rebooted from the echo b > /proc/sysrq-trigger, so I installed mailsend and THAT is doing the same thing.  Please, if someone can confirm if packages in http://downloads.openwrt.org/snapshots/ … ackages.gz are no longer compatible with 3.18.10n that would help my sanity.  And if they are compiled for later/encompatible, how do you get packages for older mvebu builds .... or, what am I doing wrong?  How would I see the problem?

root@OpenWrt:~# opkg install curl
Installing curl (7.43.0-1) to root...
Downloading http://downloads.openwrt.org/snapshots/trunk/mvebu/generic/packages/base/curl_7.43.0-1_mvebu.ipk.
Configuring curl.
root@OpenWrt:~# curl
-ash: curl: not found
root@OpenWrt:~# /usr/bin/curl
-ash: /usr/bin/curl: not found

Evidently I missed the day we discussed updating only the Marvell s/w. Is it simple to add it to RC3?

@Davidc502

what really is the difference between the two scripts?

--------------------------------------------------------
#!/bin/sh
echo 1 >/proc/irq/27/smp_affinity
echo 2 >/proc/irq/28/smp_affinity
echo 1 >/proc/irq/88/smp_affinity
echo 2 >/proc/irq/89/smp_affinity
--------------------------------------------------------

AND

--------------------------------------------------------
#!/bin/sh
# buy time otherwise files are written over during boot
ping 192.168.1.1 -c 6
# split wifi and ethernet on two different processors
echo 2 > /proc/irq/87/smp_affinity
echo 2 > /proc/irq/27/smp_affinity
--------------------------------------------------------

alirz wrote:

@Davidc502

what really is the difference between the two scripts?

--------------------------------------------------------
#!/bin/sh
echo 1 >/proc/irq/27/smp_affinity
echo 2 >/proc/irq/28/smp_affinity
echo 1 >/proc/irq/88/smp_affinity
echo 2 >/proc/irq/89/smp_affinity
--------------------------------------------------------

AND

--------------------------------------------------------
#!/bin/sh
# buy time otherwise files are written over during boot
ping 192.168.1.1 -c 6
# split wifi and ethernet on two different processors
echo 2 > /proc/irq/87/smp_affinity
echo 2 > /proc/irq/27/smp_affinity
--------------------------------------------------------


Essentially, it was my first attempt, and at the time thought about how to manually separating the two. I came to realize that even though affinity was set to 3, it was really only using cpu 0, so I simplified the script to just send irq 87 and 27 to cpu 1.

Also, I found that if the script ran at boot with no delay the changes were over written. So, I put in a ping loop, but one could use the sleep command too.

Make sense?

(Last edited by davidc502 on 15 Aug 2015, 18:09)