[ovs-dev] [PATCH] ofproto-dpif-governor: Wake up only when there is genuinely work to do.

Ben Pfaff blp at nicira.com
Wed Jun 20 20:19:04 UTC 2012


Thank you.  I pushed this to master and branch-1.7.

On Wed, Jun 20, 2012 at 01:11:10PM -0700, Ethan Jackson wrote:
> Good catch, thanks.
> 
> Ethan
> 
> On Wed, Jun 20, 2012 at 11:34 AM, Ben Pfaff <blp at nicira.com> wrote:
> > Until now, governor_wait() has awakened the poll loop whenever the
> > generation timer expires, to allow it to shrink the governor to the next
> > smaller size in governor_run().  However, if the governor is already the
> > smallest possible size, then governor_run() will not have anything to do
> > and will not restart the timer, which means that governor_wait() will again
> > immediately wake up the poll loop, and we end up using 100% CPU.
> >
> > This is kind of hard to trigger because normally the client will destroy
> > a governor in such a case.  However, if there are too many subfacets, the
> > client will keep even a minimum-size governor, triggering the bug.
> >
> > Reported-by: Alex Yip <alex at nicira.com>
> > Signed-off-by: Ben Pfaff <blp at nicira.com>
> > ---
> >  ofproto/ofproto-dpif-governor.c |    4 +++-
> >  1 files changed, 3 insertions(+), 1 deletions(-)
> >
> > diff --git a/ofproto/ofproto-dpif-governor.c b/ofproto/ofproto-dpif-governor.c
> > index 817186a..458f8d7 100644
> > --- a/ofproto/ofproto-dpif-governor.c
> > +++ b/ofproto/ofproto-dpif-governor.c
> > @@ -93,7 +93,9 @@ governor_run(struct governor *g)
> >  void
> >  governor_wait(struct governor *g)
> >  {
> > -    poll_timer_wait_until(g->start + MAX_ELAPSED);
> > +    if (g->size > MIN_SIZE) {
> > +        poll_timer_wait_until(g->start + MAX_ELAPSED);
> > +    }
> >  }
> >
> >  /* Returns true if 'g' has been doing only a minimal amount of work and thus
> > --
> > 1.7.2.5
> >
> > _______________________________________________
> > dev mailing list
> > dev at openvswitch.org
> > http://openvswitch.org/mailman/listinfo/dev



More information about the dev mailing list