Date: Tue, 10 Jul 2007 10:19:50 +0400 From: Eygene Ryabinkin <rea-fbsd@codelabs.ru> To: Nate Lawson <nate@root.org> Cc: freebsd-pf@freebsd.org Subject: Re: pf 4.1 Update available for testing Message-ID: <20070710061950.GB38151@void.codelabs.ru> In-Reply-To: <468ACC91.9010806@root.org> References: <200706160347.33331.max@love2party.net> <20070617094126.GT3779@void.codelabs.ru> <200706171717.21585.max@love2party.net> <20070619074150.GC26920@void.codelabs.ru> <4677FF00.4060506@root.org> <20070620152609.GD26920@void.codelabs.ru> <20070620190423.GH26920@void.codelabs.ru> <468ACC91.9010806@root.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20070710061950.GB38151>