[ovs-dev] [PATCH 4/5] pool-loop: Enable checking whether a FD caused a wakeup.

Ben Pfaff blp at nicira.com
Thu Sep 22 21:01:33 UTC 2011


On Thu, Sep 22, 2011 at 01:58:49PM -0700, Jesse Gross wrote:
> On Thu, Sep 22, 2011 at 12:48 PM, Ben Pfaff <blp at nicira.com> wrote:
> > On Mon, Sep 19, 2011 at 03:00:07PM -0700, Jesse Gross wrote:
> >> Each time we run through the poll loop, we check all file descriptors
> >> that we were waiting on to see if there is data available. ??However,
> >> this requires a system call and poll already provides information on
> >> which FDs caused the wakeup so it is inefficient as the number of
> >> active FDs grows. ??This provides a way to check whether a given FD
> >> has data.
>
> > I'm nervous about using linear search here, since we'll be growing the
> > number of fds significantly.
> 
> I thought about this before but the problem is that you trade off the
> cost of the doing a single lookup for increased cost in building
> whatever data structure you use to get better than linear performance.
>  In this case we actually rebuild it quite frequently (each trip
> through the poll loop) so it wasn't clear to me that it was a good
> tradeoff.  I can think of some ways to optimize this (for one thing,
> we probably have the same set of FDs the vast majority of the time)
> but I didn't want to go too far down that path without data as it
> whether it's a real problem.

I'm OK with it for now.



More information about the dev mailing list