From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Kuwahara,T." <6vvetjsrt26xsrzlh1z0zn4d2grdah-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> Subject: Re: [PATCH V7 1/8] ntp: add ADJ_SETOFFSET mode bit Date: Wed, 22 Dec 2010 05:57:02 +0900 Message-ID: References: <880d82bb8120f73973db27e0c48e949014b1a106.1292512461.git.richard.cochran@omicron.at> <20101221075612.GA13626@riccoc20.at.omicron.at> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Return-path: In-Reply-To: <20101221075612.GA13626-7KxsofuKt4IfAd9E5cN8NEzG7cXyKsk/@public.gmane.org> Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Richard Cochran Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Alan Cox , Arnd Bergmann , Christoph Lameter , David Miller , John Stultz , Krzysztof Halasa , Peter Zijlstra , Rodolfo Giometti , Thomas Gleixner List-Id: linux-api@vger.kernel.org On Tue, Dec 21, 2010 at 4:56 PM, Richard Cochran wrote: > Can you please elaborate? The timex.constant is defined as equal to the binary logarithm of the reciprocal of the natural frequency minus SHIFT_PLL. In other words, the following equation holds: log2(natural frequency) + time_constant + SHIFT_PLL = 0, which means that decreasing time_constant increases natural frequency exponentially. And since a larger natural frequency gives a smaller settling time, a sufficiently large negative time_constant results in immediate time step, at least in theory. > I don't see any way to use timex.constant with ADJ_OFFSET in order to > correct a time offset. How about this? if (txc->modes & ADJ_OFFSET) { if (txc->constant == INT32_MIN) { /* step time */ } else { /* slew time */ } } > The 'time_constant' in kernel/time/ntp.c is > restricted to the interval [0..MAXTC], and MAXTC is 10 in timex.h. Then let's just ignore the restriction. (It's possible by setting the timex.constant without setting the ADJ_TIMECONST flag.) That said, I'm somehow against the idea of using the adjtimex syscall for that purpose.