[ovs-dev] [PATCH] datapath: Don't query time for every packet.

Ben Pfaff blp at nicira.com
Fri Jul 23 18:26:21 UTC 2010


On Thu, Jul 22, 2010 at 05:13:50PM -0700, Jesse Gross wrote:
> On Thu, Jul 22, 2010 at 1:45 PM, Ben Pfaff <blp at nicira.com> wrote:
> > OK, I see.  We're converting between two scales based on a fixed point
> > and a conversion factor, like converting between Fahrenheit and Celsius
> > by knowing that 32 F = 0 C and that there are 1.8 degF per degC.  But
> > instead of using a *fixed* fixed point, like 32 F = 0 C, we're using a
> > *variable* fixed point.  It's like, every time you want to convert
> > between temperature scales, walking over to the thermometer and reading
> > off that it's currently 72 degF and 22 degC and writing out a new
> > equation based on those facts.
> >
> > So: can we used a *fixed* fixed point somehow?  It would be cheaper than
> > obtaining the current time for every conversion, and it might be more
> > accurate.
> >
> 
> I can think of a couple of ways that to do this but they assume that the
> relationship between jiffies and time is fixed.  I haven't been able to
> convince myself that this is true, especially across different kernel
> versions and architectures.  It's probably fine most of the time but events
> like suspend/resume and lost interrupts seem likely to cause problems.  In
> any case, the two definitely come from different sources, so there is a
> potential for drift.  We can still run into these types of problems with
> this implementation but at least they will be limited to the duration of a
> flow, rather than potentially accumulating over time.
> 
> Do you know of something that would guarantee that the relationship is
> fixed?

I don't.  You are probably right.

The only case where it really bothers me that we call this is where
we're dumping a number of flows in a single system call.  Could we at
least amortize obtaining the conversion factor over all the flows that
we grab in a single system call?




More information about the dev mailing list