ofproto-dpif-governor: Wake up only when there is genuinely work to do.
authorBen Pfaff <blp@nicira.com>
Wed, 20 Jun 2012 20:18:25 +0000 (13:18 -0700)
committerBen Pfaff <blp@nicira.com>
Wed, 20 Jun 2012 20:18:25 +0000 (13:18 -0700)
commit91d345e4fd204aaf1938d1465261199e97e91ae9
tree0c89e3307a5d1a012d5e1d2ee47d038733951cb2
parent59efa47adf3234ec51541405726d033173851285
ofproto-dpif-governor: Wake up only when there is genuinely work to do.

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.

Bug #12106.
Reported-by: Alex Yip <alex@nicira.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
ofproto/ofproto-dpif-governor.c