RPi2 i/o blocking and SD card performance

Warner Losh wlosh at bsdimp.com
Thu Jun 9 15:13:43 UTC 2016


> On Jun 9, 2016, at 10:40 AM, Ian Lepore <ian at freebsd.org> wrote:
> 
> On Thu, 2016-06-09 at 09:55 -0400, Warner Losh wrote:
>>> On Jun 9, 2016, at 5:37 AM, Gergely Imreh <imrehg at gmail.com> wrote:
>>> 
>>> Hi,
>>> 
>>> I've been testing FreeBSD 11.0-CURRENT on a RaspberryPi2. I'm relatively
>>> new to FreeBSD, and wondering if there's any advice for improving the
>>> performance a bit.
>>> 
>>> First, it looks like there's a lot of i/o blocking behaviour going on. For
>>> example running MediaWiki on the board, if I compile any ports, the site
>>> itself is pretty much unusable (the PHP scripts time out even with 180s
>>> timeouts). The strangest thing is that the CPU usage is not at 100% all the
>>> way, can be that all 4 cores are ~99% idle, and still everything goes very
>>> slow. Once the ports compilation or any other i/o-related task is finished,
>>> it's snappy again.
>>> 
>>> Any idea why it could be to have such big latency/lag even though the CPU
>>> is idle? Is there anything I could test?
>> 
>> What´s the HZ for the system? The sd/mmc system has a lot of context switches
>> may be one reason for this.
> 
> What does HZ have to do with it?  That's a serious question I've been
> asking for about 3 years now, and have not gotten an answer (any answer
> from anyone): "What influence does HZ have on modern freebsd?"  (Modern
> meaning roughly "with eventtimers implemented and the ULE scheduler.")
> 
> The little bit of testing I've tried to do hasn't shown any difference
> at all that I can detect between HZ=100 and HZ=5000, or any values
> in-between.

That’s a good data point. Once upon a time there were places in the SD stack
where there were 1 tick sleeps that would show a big difference in the latency 
because of them. If you aren’t seeing any difference, those must be officially
dead.

Warner



More information about the freebsd-arm mailing list