Interrupts + Polling mode (similar to Linux's NAPI)

Andrew Brampton brampton+freebsd-net at gmail.com
Fri Mar 27 04:05:02 PDT 2009


2009/3/27 Luigi Rizzo <rizzo at iet.unipi.it>:
> The load of polling is pretty low (within 1% or so) even with
> polling. The advantage of having interrupts is faster response
> to incoming traffic, not CPU load.

oh, I was under the impression that polling spun in a tight loop, thus
using 100% of the processor. After a quick test I see this is not the
case. I assume it will get to 100% CPU load if I saturate my network.

>
> There is nothing difficult in having both active, except figuring
> out a good logic for when to disable polling on an interface
> that has been quiet for a while.

Looking at Linux's logic, it appears to poll until there are no more
packets, and thus re-enables interrupts.

>
> I don't know what is the status of polling these days -- when i
> wrote it, the architecture was designed for UP kernels, and I
> don't know if/how it has been revised to deal efficiently with
> the SMP kernels we have now (in other words: one or multiple
> polling loops, interaction with interrupt threads, etc.)

So, do you think the interrupt+polling has a place in FreeBSD? Now
that I know that Polling doesn't consume 100% of the processor, it
might be best to "keep it simple stupid".

>
>        cheers
>        luigi
>

Thanks for answer my questions, and thanks for writing polling support
in the beginning!

Andrew


More information about the freebsd-net mailing list