[Bloat] Testing fq_codel on Android Galaxy Nexus AK kernel

Mário Sérgio Fujikawa Ferreira liouxbsd at gmail.com
Sat Mar 9 20:26:55 EST 2013


On 09/03/2013 22:21, Mário Sérgio Fujikawa Ferreira wrote:
> Further information gathering. I won't procced with any further 
> testing. I am neither sure how to interpret the data I already have 
> for wlan0 nor that I am using the proper tools for the job.
>
>   I look forward to your input. I would like to be able to gather good 
> values for both quantum and limit. I want to set them appropriately 
> for the radio and wifi connections. Since we don't have the properly 
> patched tc command, I'll probably be hard coding this on the fq_codel 
> module itself.
>
>   Are there recommendations? If a guideline is available/suggested, 
> I'll try to find good average values for this particular phone.
>
>   The data I gathered currently follows:
>
> - Android phone Samsung Galaxy Nexus GSM I9250 running stock Yakju 
> 4.2.2 with AK kernel
> - WIFI connected to LAN, ADSL 512KiB U, Phone Google Drive upload at 
> full speed. No other traffic on the network
> - The drivers are available in binary form from 
> https://developers.google.com/android/nexus/drivers
> - Quick look on the Galaxy Nexus 
> http://wiki.rootzwiki.com/Samsung_Galaxy_Nexus
> - There is a teardown of all components on 
> http://www.ifixit.com/Teardown/Samsung+Galaxy+Nexus+Teardown/7182/1
>     - Radio: Intel XG626 Baseband Modem
>     - WiFi / Bluetooth module: Broadcom BCM4330
>         - Samsung SWB-B42 BT 4.0 Dual Band Wlan FM Tx/Rx. Chipworks 
> says the module is actually manufactured by Murata, and houses a 
> Broadcom BCM4330 die inside.
>
> # uname -a
> Linux localhost 3.0.67+~ak.710.422.Cylon #1 SMP PREEMPT Wed Feb 27 
> 06:54:36 CET 2013 armv7l GNU/Linux
> # netcfg
> lo       UP                                   127.0.0.1/8 0x00000049
> ifb0     DOWN                                   0.0.0.0/0 0x00000082
> ifb1     DOWN                                   0.0.0.0/0 0x00000082
> tunl0    DOWN                                   0.0.0.0/0 0x00000080
> sit0     DOWN                                   0.0.0.0/0 0x00000080
> ip6tnl0  DOWN                                   0.0.0.0/0 0x00000080
> rmnet0   DOWN                                   0.0.0.0/0 0x00001090
> rmnet1   DOWN                                   0.0.0.0/0 0x00001090
> rmnet2   DOWN                                   0.0.0.0/0 0x00001090
> p2p0     UP                                     0.0.0.0/0 0x00001003
> wlan0    UP                                  10.0.0.101/25 0x00001043
> # ls -l /sys/class/net/p2p0/
> -r--r--r-- root     root         4096 2013-03-02 21:33 addr_assign_type
> -r--r--r-- root     root         4096 2013-03-02 21:33 addr_len
> -r--r--r-- root     root         4096 2013-03-02 21:33 address
> -r--r--r-- root     root         4096 2013-03-02 21:33 broadcast
> -r--r--r-- root     root         4096 2013-03-02 21:33 carrier
> -r--r--r-- root     root         4096 2013-03-02 21:33 dev_id
> lrwxrwxrwx root     root              2013-03-02 21:33 device -> 
> ../../../mmc1:0001:2
> -r--r--r-- root     root         4096 2013-03-02 21:33 dormant
> -r--r--r-- root     root         4096 2013-03-02 21:33 duplex
> -r--r--r-- root     root         4096 2013-03-02 21:33 features
> -rw-r--r-- root     root         4096 2013-03-02 21:33 flags
> -rw-r--r-- root     root         4096 2013-03-02 21:33 ifalias
> -r--r--r-- root     root         4096 2013-03-02 21:33 ifindex
> -r--r--r-- root     root         4096 2013-03-02 21:33 iflink
> -r--r--r-- root     root         4096 2013-03-02 21:33 link_mode
> -rw-r--r-- root     root         4096 2013-03-02 21:33 mtu
> -rw-r--r-- root     root         4096 2013-03-02 21:33 netdev_group
> -r--r--r-- root     root         4096 2013-03-02 21:33 operstate
> lrwxrwxrwx root     root              2013-03-02 21:33 phy80211 -> 
> ../../ieee80211/phy0
> drwxr-xr-x root     root              2013-03-02 21:33 power
> drwxr-xr-x root     root              2013-03-02 21:33 queues
> -r--r--r-- root     root         4096 2013-03-02 21:33 speed
> drwxr-xr-x root     root              2013-03-02 21:33 statistics
> lrwxrwxrwx root     root              2013-03-02 21:33 subsystem -> 
> ../../../../../../../../../../class/net
> -rw-r--r-- root     root         4096 2013-03-02 21:33 tx_queue_len
> -r--r--r-- root     root         4096 2013-03-02 21:33 type
> -rw-r--r-- root     root         4096 2013-03-02 21:33 uevent
>
> # ls -l /sys/class/net/wlan0/
> -r--r--r-- root     root         4096 2013-03-02 21:38 addr_assign_type
> -r--r--r-- root     root         4096 2013-03-02 21:38 addr_len
> -r--r--r-- root     root         4096 2013-03-02 21:38 address
> -r--r--r-- root     root         4096 2013-03-02 21:38 broadcast
> -r--r--r-- root     root         4096 2013-03-02 21:38 carrier
> -r--r--r-- root     root         4096 2013-03-02 21:38 dev_id
> lrwxrwxrwx root     root              2013-03-02 21:38 device -> 
> ../../../mmc1:0
> 001:2
> -r--r--r-- root     root         4096 2013-03-02 21:38 dormant
> -r--r--r-- root     root         4096 2013-03-02 21:38 duplex
> -r--r--r-- root     root         4096 2013-03-02 21:38 features
> -rw-r--r-- root     root         4096 2013-03-02 21:38 flags
> -rw-r--r-- root     root         4096 2013-03-02 21:38 ifalias
> -r--r--r-- root     root         4096 2013-03-02 21:38 ifindex
> -r--r--r-- root     root         4096 2013-03-02 21:38 iflink
> -r--r--r-- root     root         4096 2013-03-02 21:38 link_mode
> -rw-r--r-- root     root         4096 2013-03-02 21:38 mtu
> -rw-r--r-- root     root         4096 2013-03-02 21:38 netdev_group
> -r--r--r-- root     root         4096 2013-03-02 21:38 operstate
> lrwxrwxrwx root     root              2013-03-02 21:38 phy80211 -> 
> ../../ieee80211/phy0
> drwxr-xr-x root     root              2013-03-02 21:38 power
> drwxr-xr-x root     root              2013-03-02 21:38 queues
> -r--r--r-- root     root         4096 2013-03-02 21:38 speed
> drwxr-xr-x root     root              2013-03-02 21:31 statistics
> lrwxrwxrwx root     root              2013-03-02 21:38 subsystem -> 
> ../../../../../../../../../../class/net
> -rw-r--r-- root     root         4096 2013-03-02 21:38 tx_queue_len
> -r--r--r-- root     root         4096 2013-03-02 21:38 type
> -rw-r--r-- root     root         4096 2013-03-02 21:38 uevent
>
>   By quick traffic examination, it seems that all WIFI traffic flows 
> through wlan0:
>
> # tc -s qdisc
> Android does not support qdisc 'fq_codel'
> qdisc fq_codel 8001: dev rmnet0 root refcnt 2 [cannot parse qdisc 
> parameters]
>  Sent 0 bytes 0 pkt (dropped 0, overlimits 0 requeues 0)
>  backlog 0b 0p requeues 0
> Android does not support qdisc 'prio'
> qdisc pfifo_fast 0: dev p2p0 root refcnt 2 [cannot parse qdisc 
> parameters]
>  Sent 468 bytes 6 pkt (dropped 0, overlimits 0 requeues 0)
>  backlog 0b 0p requeues 0
> Android does not support qdisc 'prio'
> qdisc pfifo_fast 0: dev wlan0 root refcnt 2 [cannot parse qdisc 
> parameters]
>  Sent 38442999 bytes 26737 pkt (dropped 0, overlimits 0 requeues 0)
>  backlog 0b 0p requeues 0
>
>   Here follows the information on wlan0 interface:
>
> # cat /sys/class/net/wlan0/tx_queue_len
> 1000
> # cat /sys/class/net/wlan0/speed
> sh: cat: /sys/class/net/wlan0/speed: Invalid argument
> # ls -l /sys/class/net/wlan0/queues
> drwxr-xr-x root     root              2013-03-02 22:04 rx-0
> drwxr-xr-x root     root              2013-03-02 22:04 tx-0
> # ls -l /sys/class/net/wlan0/queues/tx-0
> -rw-r--r-- root     root         4096 2013-03-02 22:04 xps_cpus
>
>   Tests follow in the next email.

   Let's try to measure the hardware buffer by sending 500 pings to 
187.7.117.32 with "Net Ping" from Play Store. I'll use different 
txqueuelen values each time. There is a concurrent upload at full speed 
to Google Drive.

# echo 0 > /sys/class/net/wlan0/tx_queue_len
# cat /sys/class/net/wlan0/tx_queue_len
0

500 pings
(187.7.117.32) min-max: 61.6-1058 ms
(187.7.117.32) avg/stddev: 315/167 ms

# echo 1 > /sys/class/net/wlan0/tx_queue_len

500 pings
(187.7.117.32) min-max: 60.3-1365 ms
(187.7.117.32) avg/stddev: 602/310 ms

# echo 10 > /sys/class/net/wlan0/tx_queue_len

500 pings
(187.7.117.32) min-max: 61.2-1337  ms
(187.7.117.32) avg/stddev: 571/288 ms

# echo 100 > /sys/class/net/wlan0/tx_queue_len

500 pings
(187.7.117.32) min-max: 61.2-1455  ms
(187.7.117.32) avg/stddev: 647/343 ms

# echo 1000 > /sys/class/net/wlan0/tx_queue_len

500 pings
(187.7.117.32) min-max: 60.0-1484  ms
(187.7.117.32) avg/stddev: 616/342 ms

     Repeat the above tests without the concurrent upload.

# echo 0 > /sys/class/net/wlan0/tx_queue_len
# echo 0 > /sys/class/net/p2p0/tx_queue_len

500 pings
(187.7.117.32) min-max: 61.7-213 ms
(187.7.117.32) avg/stddev: 70.6/15.0 ms

# echo 1 > /sys/class/net/wlan0/tx_queue_len

500 pings
(187.7.117.32) min-max: 60.7-207 ms
(187.7.117.32) avg/stddev: 70.5/15.4 ms

# echo 10 > /sys/class/net/wlan0/tx_queue_len

500 pings
(187.7.117.32) min-max: 60.6-244  ms
(187.7.117.32) avg/stddev: 69.1/10.5 ms

# echo 100 > /sys/class/net/wlan0/tx_queue_len

500 pings
(187.7.117.32) min-max: 60.7-246  ms
(187.7.117.32) avg/stddev: 70.1/15.4 ms

# echo 1000 > /sys/class/net/wlan0/tx_queue_len

500 pings
(187.7.117.32) min-max: 61.4-251  ms
(187.7.117.32) avg/stddev: 70.2/16.3 ms

   I've disabled WIFI and enabled 3G. I've got a HDSPA connection.

# netcfg
lo       UP                                   127.0.0.1/8 0x00000049
00:00:00
ifb0     DOWN                                   0.0.0.0/0 0x00000082
f9:64:69
ifb1     DOWN                                   0.0.0.0/0 0x00000082
c6:b4:f9
tunl0    DOWN                                   0.0.0.0/0 0x00000080
00:00:00
sit0     DOWN                                   0.0.0.0/0 0x00000080
00:00:00
ip6tnl0  DOWN                                   0.0.0.0/0 0x00000080
00:00:00
rmnet0   UP                              179.225.225.71/24 0x000010d1
00:00:00
rmnet1   DOWN                                   0.0.0.0/0 0x00001090
00:00:00
rmnet2   DOWN                                   0.0.0.0/0 0x00001090
00:00:00
p2p0     DOWN                                   0.0.0.0/0 0x00001002
c5:c2:4e
wlan0    DOWN                                   0.0.0.0/0 0x00001002

   Here follows the information on rmnet0 interface:

# cat /sys/class/net/rmnet0/tx_queue_len
1000
# cat /sys/class/net/rmnet0/speed
/system/bin/sh: cat: /sys/class/net/rmnet0/speed: Invalid argument
# ls -l /sys/class/net/rmnet0/queues
drwxr-xr-x root     root              2013-03-03 15:03 rx-0
drwxr-xr-x root     root              2013-03-03 15:03 tx-0
# ls -l /sys/class/net/rmnet0/queues/tx-0
-rw-r--r-- root     root         4096 2013-03-03 15:03 xps_cpus

   I will await for your orientation before doing any other testing. 
I've submitted patches to change the default fq_codel limit from 10*1024 
to 600 which seem to be reasonable for cel radio/wifi speeds according to:

http://www.bufferbloat.net/projects/codel/wiki/Best_Practices_for_Benchmarking_CoDel_and_FQ_CoDel

   Also, I'm pushing for the addition of TCP Small Queues. What default 
value do you suggest we use there? The default is 131032. Should I use a 
small default?

   Best regards,
     Mário Sérgio



More information about the Bloat mailing list