[ovs-git] [openvswitch/ovs] f58578: ofproto-dpif: Cache result of time_msec() for rule...
noreply at github.com
Thu Jun 2 20:22:08 UTC 2016
Author: Daniele Di Proietto <diproiettod at vmware.com>
Date: 2016-06-02 (Thu, 02 Jun 2016)
ofproto-dpif: Cache result of time_msec() for rule_expire().
In the run() function of ofproto-dpif we call rule_expire() for every
possible flow that has a timeout and rule_expire() calls time_msec().
Calling time_msec() repeatedly can be pretty expensive, even though most
of the time it involves only a vdso call.
This commit calls time_msec only once in run(), to reduce the workload.
Keeping the flows ordered by expiration in some kind of heap or timing
wheel data structure could help make this process more efficient, if
rule_expire() turns out to be a bottleneck.
Signed-off-by: Daniele Di Proietto <diproiettod at vmware.com>
Acked-by: Ben Pfaff <blp at ovn.org>
More information about the git