MT6000 custom build with LuCi and some optimization - kernel 6.6.x

Fair enough - just warn that there could be fireworks ahead...

It would be one thing if the prempt patchset was in the kernel, but it's not as of yet -actively maintained, much like irqbalance - there a set of folks that are pretty adverse to mucking about with the scheduler out of tree...

goes back to how to manage forks inside github - if @pesa1234 is doing git right, it's trival to fork for your testing, and if good, can do the PR to merge back.

I think this is the safe approach here - but that's only my thoughts..

No need for separate thread, indeed i would be very much interested in knowing summery of this discussion in past, i seriously don't know what happened at my end but during a running system, plugged out my drive and plugged in and woov, it is detected right, see below

root@OpenWrt:~# lsusb
Bus 001 Device 001: ID 1d6b:0002 Linux 6.6.87 xhci-hcd xHCI Host Controller
Bus 001 Device 002: ID 1d5c:5011 Fresco Logic, Inc. USB2.0 Hub
Bus 002 Device 001: ID 1d6b:0003 Linux 6.6.87 xhci-hcd xHCI Host Controller
Bus 002 Device 002: ID 1d5c:5001 Fresco Logic, Inc. USB3.0 Hub
Bus 002 Device 003: ID 0bda:9210 Realtek RTL9210B
root@OpenWrt:~# lsusb -t
/:  Bus 001.Port 001: Dev 001, Class=root_hub, Driver=xhci-mtk/2p, 480M
    |__ Port 002: Dev 002, If 0, Class=[unknown], Driver=hub/4p, 480M
/:  Bus 002.Port 001: Dev 001, Class=root_hub, Driver=xhci-mtk/1p, 20000M/x2
    |__ Port 001: Dev 002, If 0, Class=[unknown], Driver=hub/4p, 5000M/x2
        |__ Port 002: Dev 003, If 0, Class=[unknown], Driver=uas, 5000M
root@OpenWrt:~#

Since than rebooted couple of times but I'm unable to produce issue, whatever it was, now disabled ksmbd and using block mount as well

Wifi performance is truly amazing, rock solid, played codm to test ping and it's as good as Ethernet connected

Tickless kernel is outside of perhaps what you're looking at - this is kernel plumbing stuff, and probably best for folks to see results rather than see what goes into the sausage...

Looks like next-r4.5.34.rss.mtk is stable (for me anyway). Using latest/last updated commit for 4.5.34.

Last commit hash: 5111451803
WED: Enabled
ATF: Off
HW ATF: Off
EDCCA: On - Auto
HQoS: Disabled

There will only be fireworks if people make them.

What? I'm going to need you to expound on this one because I'm scratching my head here. The only thing I can assume you're referring to is the realtime patches that are outside of mainline (prior to kernel 6.12) and are needed to produce a realtime (read: not just tickless) kernel. That would also require enabling the PREEMPT_RT config attribute, which anyone who looked at my test patch would realize I did not enable.

Preemption is already in mainline and has been for a long time.

Also, there are already some tickless changes going on with the x86 platform.

Again, scratching my head here. It has to be tested somewhere (right??) and if it proves fruitful, it would be introduced via PR.

I know how forking and PRs work, thanks. :wink: My point earlier in this thread was that I have no intent in forking and producing my own test images. Obviously I have my own "fork" of Pesa's build with which I test against.

I have full confidence in saying right now that the patch I posted is "good" in that it has not broken any of my three MT6000s. It's not "testing" in that sense of the word. But what I am looking for is a few brave and interested individuals to join in testing with the kernel updates and run some benchmarks along with me to see if we can prove, or disprove, the efficacy of the patch on 1) network latency, 2) network jitter, and 3) network throughput.

I have the utmost confidence that if one knows how to take the patch I have put out there, build it into their own image, and flash to their device(s), they will have the technical prowess to come back to this forum and report back their findings. If one doesn't know how to apply the patch I put out there (or simply doesn't care to), then it's just not for that person at this time. Simple. :smiley:

Maybe there is no measurable gain to be had. Maybe it causes a performance regression. That's the experiment, though, and we need to let the results speak for themselves.

5 Likes

I'm agree. Can I ask why these setting? I ask because I didn't know why it is necessary.

+CONFIG_CMDLINE=" root=PARTLABEL=rootfs rootwait rcu_nocb_poll"
+CONFIG_CMDLINE_FORCE=y

I don't understand if you remove automount feature, but if you use block-mount I suggest to remove automount script located on: /etc/hotplug.d/10-mountdsk and 50-ksmbd

The reason for including that command line config for now is that the default MT6000 boot string is this:

root@AP-Office:~# cat /proc/cmdline
 root=PARTLABEL=rootfs rootwait

As far as I can tell, rcu_nocb_poll is a boot-time option only. So in order to include it in the boot string I added the CONFIG_CMDLINE and CONFIG_CMDLINE_FORCE=y options. In our MT6000 target, the CONFIG_CMDLINE is ignored unless CONFIG_CMDLINE_FORCE is enabled.

As for why I'm testing enabling of rcu_nocb_poll, that follows some pretty well documented info from Ubuntu: https://documentation.ubuntu.com/real-time/en/latest/how-to/cpu-boot-configs/#offloaded-rcu-callbacks

Because CONFIG_RCU_NOCB_CPU_DEFAULT_ALL=y is set, that implies rcu_nocbs=all and therefore there is no "housekeeping CPU" (per my understanding). Therefore rcu_nocb_poll allows RCU threads to be woken up with a timer.

A lot of this is subject to testing and tweaking, so there may very well be combinations of these kernel config options that lead to better or worse results. That's the fun in testing :slight_smile:

2 Likes

PREMPT_RT was merged in with Kernel 6.12 (back in Sept '24).

I have no problem experiementing with it - just make sure that everything is tested - not just here and there...

There's times where I have to trust the systems engineering folks at Qualcomm and Mediatek - if preemption was beneficial, you can bet it would have been part of their respective SDK's

You are confusing different settings here. These are all different settings that can be toggled independently:

  • Tickless
  • 100, 250, 300 or 1000 Hz.
  • No preemption, voluntary preemption, full preemption and finally RT.
  • There is also a completely separate PREEMPT_LAZY (which I don't really know much about).
2 Likes

Found some weird bug in the latest release based on OpenWrt SNAPSHOT r29721-5111451803 - you cannot change network in Wifi-network settings, button Save doesn't react after changes


. Previous release works fine,

I just try this and it works, sorry I can not replicate.

can you post output of:

uci show wireless
uci show network

please remove relevant information like passphrase

if the settings are ok you can set the device with command

uci set wireless.default_radioX.network='USR'

where X can be 0 or 1....

2 Likes

Finally set aside some time today to do some quantitative testing. Here is a link to my uploaded data, but below is a visual summary of my results.

I tested four different configurations:

  1. Standard kernel with the AQL fq_limit at 8192 (default)
  2. Standard kernel with the AQL fq_limit lowered to 2048
  3. Tweaked kernel with the AQL fq_limit at 8192 (default)
  4. Tweaked kernel with the AQL fq_limit lowered to 2048

Testing Methodology:

  • I ran five (5) Crusader tests per configuration type
  • Used Crusader default settings, except for the time per test (download, upload, combined) was set to 60 seconds.
  • The MT6000 (configured as dumb AP) I used in testing was connected via 2.5Gb ethernet back to the test server which was running Crusader.
  • I limited my MT6000 to only allow my test machine (MacBook Pro M3) to connect for the duration of the testing.
  • The test machine was located in exactly the same spot, approximately 10 feet away from the AP, during the duration of all the tests.
  • The AP does not have irqbalance or packet steering enabled.
  • The AQL configuration was configured as per Pesa's defaults, with the exception of tweaking fq_limit as I noted previously.
  • The results of the five (5) tests per configuration type were averaged per configuration type.

Summarized Results:
next-r4.5.34.rss.mtk/Standard_vs_Tweaked_Kernel.png
next-r4.5.34.rss.mtk/Standard-vs-Tweaked-Kernel-Testing.xlsx

I'll hold my assessment of the data for now as I am more curious to know how the community here interprets the results. Thanks!

5 Likes

Interesting - the charts, you have to normalize them, and the deltas are less significant, and start to fall into the noise...

Yes, taking a look at things, after folks rebuked my earlier statements...

working on Master/snapshot...

root@thumper:~# uname -a
Linux thumper 6.6.87 #0 SMP PREEMPT_DYNAMIC Sun Apr 27 09:14:31 2025 aarch64 GNU/Linux

Nice there, as I can toggle options on boot time...

Not sure what you mean by “normalize them.” There are some really interesting things going on in that data. Some things were quite surprising. Don’t be too quick to dismiss them as noise.

I don’t understand.

Some things can be toggled at boot time, sure.

Base them from zero...

Your charts distort things by showing small improvements as something that isn't significant...

1 Like

Does this version have to option to change tx power to 30dbm? the stock firmware is locked at 20dbm. Thanks

uci show wireless
uci show wireless
wireless.radio0=wifi-device
wireless.radio0.type='mac80211'
wireless.radio0.path='platform/soc/18000000.wifi'
wireless.radio0.band='2g'
wireless.radio0.channel='6'
wireless.radio0.htmode='HE20'
wireless.radio0.itxbfen='1'
wireless.radio0.cell_density='0'
wireless.radio0.txpower='30'
wireless.radio0.country='US'
wireless.radio0.vendor_vht='1'
wireless.radio0.disabled='1'
wireless.radio1=wifi-device
wireless.radio1.type='mac80211'
wireless.radio1.path='platform/soc/18000000.wifi+1'
wireless.radio1.band='5g'
wireless.radio1.channel='100'
wireless.radio1.htmode='HE160'
wireless.radio1.itxbfen='1'
wireless.radio1.txpower='23'
wireless.radio1.country='US'
wireless.radio1.cell_density='0'
wireless.wifinet0=wifi-iface
wireless.wifinet0.device='radio0'
wireless.wifinet0.mode='ap'
wireless.wifinet0.ssid='Tatastha'
wireless.wifinet0.encryption='sae'
wireless.wifinet0.key='MyPassword'
wireless.wifinet0.ieee80211r='1'
wireless.wifinet0.mobility_domain='1088'
wireless.wifinet0.ft_over_ds='0'
wireless.wifinet0.ieee80211k='1'
wireless.wifinet0.ocv='0'
wireless.wifinet0.network='USR_net'
wireless.wifinet0.disabled='1'
wireless.wifinet1=wifi-iface
wireless.wifinet1.device='radio1'
wireless.wifinet1.mode='ap'
wireless.wifinet1.ssid='Tatastha'
wireless.wifinet1.encryption='sae'
wireless.wifinet1.network='USR_net'
wireless.wifinet1.key='MyPassword'
wireless.wifinet1.ieee80211r='1'
wireless.wifinet1.mobility_domain='1088'
wireless.wifinet1.ft_over_ds='0'
wireless.wifinet1.ieee80211k='1'
wireless.wifinet1.ocv='0'
wireless.wifinet1.disabled='1'
wireless.wifinet2=wifi-iface
wireless.wifinet2.device='radio0'
wireless.wifinet2.mode='ap'
wireless.wifinet2.ssid='Tatastha-IOT'
wireless.wifinet2.encryption='sae-mixed'
wireless.wifinet2.key='MyPassword'
wireless.wifinet2.ocv='0'
wireless.wifinet2.network='IOT_net'
wireless.wifinet2.disabled='1'
wireless.wifinet3=wifi-iface
wireless.wifinet3.device='radio1'
wireless.wifinet3.mode='ap'
wireless.wifinet3.ssid='Tatastha-Guest'
wireless.wifinet3.encryption='sae-mixed'
wireless.wifinet3.key='Mypassword'
wireless.wifinet3.ocv='0'
wireless.wifinet3.network='USR_net'
wireless.wifinet3.disabled='1'
uci show network
network.loopback.device='lo'
network.loopback.proto='static'
network.loopback.ipaddr='127.0.0.1'
network.loopback.netmask='255.0.0.0'
network.globals=globals
network.globals.ula_prefix='fdcc:b1e2:d8d7::/48'
network.globals.packet_steering='1'
network.globals.steering_flows='128'
network.@device[0]=device
network.@device[0].type='bridge'
network.@device[0].name='vSwitch'
network.@device[0].ports='eth1' 'lan1' 'lan2' 'lan3' 'lan4' 'lan5'
network.@bridge-vlan[0]=bridge-vlan
network.@bridge-vlan[0].device='vSwitch'
network.@bridge-vlan[0].vlan='15'
network.@bridge-vlan[0].ports='eth1' 'lan1' 'lan2' 'lan3' 'lan4' 'lan5'
network.@bridge-vlan[1]=bridge-vlan
network.@bridge-vlan[1].device='vSwitch'
network.@bridge-vlan[1].vlan='16'
network.@bridge-vlan[1].ports='eth1:t' 'lan1:t' 'lan2:t' 'lan3:t' 'lan4:t' 'lan5:t'
network.@bridge-vlan[2]=bridge-vlan
network.@bridge-vlan[2].device='vSwitch'
network.@bridge-vlan[2].vlan='17'
network.@bridge-vlan[2].ports='eth1:t' 'lan1:t' 'lan2:t' 'lan3:t' 'lan4:t' 'lan5:t'
network.@bridge-vlan[3]=bridge-vlan
network.@bridge-vlan[3].device='vSwitch'
network.@bridge-vlan[3].vlan='18'
network.@bridge-vlan[3].ports='eth1:t' 'lan1:t' 'lan2:t' 'lan3:t' 'lan4:t' 'lan5:t'
network.SVC_net=interface
network.SVC_net.proto='static'
network.SVC_net.device='vSwitch.15'
network.SVC_net.ipaddr='10.0.15.241'
network.SVC_net.netmask='255.255.255.0'
network.SVC_net.gateway='10.0.15.254'
network.SVC_net.dns='10.0.15.250'
network.IOT_net=interface
network.IOT_net.proto='none'
network.IOT_net.device='vSwitch.17'
network.GST_net=interface
network.GST_net.proto='none'
network.GST_net.device='vSwitch.18'
network.USR_net=interface
network.USR_net.proto='none'
network.USR_net.device='vSwitch.16'
network.USR=interface
network.USR.proto='none'
network.USR.device='vSwitch.16'

This is what I'm doing now, but it isnt very convenient.

Due to no mod on that part, if there's a bug will be present also on snapshot I think.

VLAN 16 for the guest wifi is specific tech choice or are you thinking of isolating it on another VLAN?

Thanks

I just created USR net to test this bug. I use VLAN18 for guest network and it is isolated on dedicated firewall device. I'm using Flint 2 as a dumb AP