pf 4.1 Update available for testing

Eygene Ryabinkin rea-fbsd at codelabs.ru
Tue Jul 10 06:19:57 UTC 2007


Nate, good day.

Tue, Jul 03, 2007 at 03:24:17PM -0700, Nate Lawson wrote:
> I have tried to achieve the same goal with a simpler patch.  Here are
> the changes:
> 
> Be sure to initialize the callout struct and other setup tasks before
> proceeding.  Previously, machclk_freq could be set to a non-zero value
> by tsc_freq_changed(), preventing the callout from being initialized.
> To fix this, call init_machclk() from all paths.  init_machclk() is
> split into two functions, one that only runs the first time it is
> called.  The second half runs each time the frequency changes and
> calibrates various items.  Also, static variables are zero so no need to
> initialize them.
> 
> If you can test this, that would be great.

Yes, it seems to work.  I am a little concerned with the dependency
your patch introduces: it assumes that init_machclk() will always
use tsc_freq as the frequency source.  So one day when another
counter will appear one will need to locate all respective references
to the tsc_freq and change them accordingly.  That was the reason
for my lengthy changes: the explicit API.  May be the simple comment
around init_machclk() will be enough, but explicit parameter will
be better.  I will try to think how it can be done with your patch,
but if any of you have some thoughts why it shouldn't be done this
way or have some other ideas -- I am all ears.

Thank you!
-- 
Eygene


More information about the freebsd-pf mailing list