pf 4.1 Update available for testing

Nate Lawson nate at root.org
Thu Jul 12 00:58:44 UTC 2007


Eygene Ryabinkin wrote:
> 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!

Thanks for your testing.  I've submitted the attached patch to re@ to go
into 7-current.  It no longer explicitly references tsc_freq in the
eventhandler.  It allows the existing eventhandler (sys/i386/i386/tsc.c
and amd64) to set tsc_freq.  Its priority is _PRI_LAST so tsc_freq is
already modified.  That way all we have to do for future time sources is
make sure they update themselves and then ALTQ only has to be changed in
init_machclk().

Once I commit it, please cvsup and test.  I'll send you notice.

-Nate
-------------- next part --------------
A non-text attachment was scrubbed...
Name: altq-fix-4.diff
Type: text/x-patch
Size: 1302 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-pf/attachments/20070712/45f65424/altq-fix-4.bin


More information about the freebsd-pf mailing list