[etherlab-dev] Sanity check: default send interval
Gavin Lambert
gavinl at compacsort.com
Wed Feb 11 00:25:05 CET 2015
Just noticed something that I think is incorrect, but I thought I'd ask for
a sanity check from the group in case I'm missing something.
In master/master.c's ec_master_init (line 213 in my patched version; line
211 in stable-1.5) there's the following line:
ec_master_set_send_interval(master, 1000000 / HZ);
According to the definition further down and the docs, that second parameter
is supposed to be the time between master application cycles in
microseconds, which is used to calculate a few queue sizes and also to
control the master thread sleep time if EC_USE_HRTIMER is defined (via
configure --enable-hrtimer).
Doesn't the use of HZ above mean that this is actually calculating "how many
seconds is 1000000 jiffies" rather than an actual microseconds value?
What's the intended default send interval?
On a somewhat related note, is there some guidance for when using
--enable-hrtimer is good or bad? Does it relate just to whether the hrtimer
is present/trusted or is there something more subtle? In terms of the code,
it just seems to be the difference between a "sleep for X time" vs. a "sleep
for 1 quantum", so it *seems* like --enable-hrtimer is good for reducing CPU
usage.
More information about the Etherlab-dev
mailing list