WLAN latency (was Re: WLAN with Linux SDIO: sneak preview)

Werner Almesberger werner at openmoko.org
Fri Nov 7 05:50:42 CET 2008

Let's make a new thread for WLAN latency. Easier to keep track of

I wrote:
> So before the ~2x improvement of using better interrupts will pay off,
> there's still a ~5x improvement to be found elsewhere.

My first suspect was code that turns off interrupts too long. I added
instrumentation to measure the times during which interrupts are
disabled [1], but the worst cases, excluding printk, were only a few
hundred microseconds.

Note that interrupts can also be disabled individually, which is
something I didn't look at here.

Then I made an interesting observation while ping-flooding the
Neo from the PC, via WLAN: all of a sudden, latency dropped to very
nice values.

Here's a comparison: round-trip-time of ping send from the Neo to the
PC, without concurrent flood-ping:

host => neo: min    /avg    /max      stddev   (100 samples)
               16.70/  81.97/ 427.00    58.35 ms

Graphically [2]:


We see an almost flat distribution from 10ms to about 150ms.

The different colors are varying bin sizes. If the height of a curve
drops by half from one bin size to the next smaller one, this means
that the samples are evenly distributed among the bins. If the height
of a peak is the same in both curves, this means that all the samples
in the wider bin came from the same narrow bin.

Now, we add a flood-ping from the PC to the Neo:


host => neo: min    /avg    /max      stddev   (100 samples)
                4.13/   7.31/  49.90     5.54 ms

This is rather interesting, since it suggests that something, e.g.,
a kernel thread, a workqueue, or a tasklet, may just not get woken
up properly.

Repeating the same test with the flood ping coming from USB did
not yield an improvement. So the problem seems to be in the
WLAN/SDIO subsystem, not the networking code or even more general
kernel services.

Without USB flood ping:
round-trip min/avg/max = 7.785/79.892/282.419 ms

With USB flood ping:
round-trip min/avg/max = 10.342/85.415/291.892 ms

[1] http://svn.openmoko.org/developers/werner/wlan-spi/patches-tracking/find-irq-blockers.patch
[2] http://svn.openmoko.org/developers/werner/wlan-perf/pingh

- Werner

More information about the openmoko-kernel mailing list