From: Karel Zak <kzak@redhat.com>
To: Stanislav Brabec <sbrabec@suse.cz>
Cc: util-linux@vger.kernel.org
Subject: Re: [PATCH 0/2] hwclock: Fix excessive adjustment
Date: Tue, 6 May 2014 12:56:45 +0200 [thread overview]
Message-ID: <20140506105645.GN5962@x2.net.home> (raw)
In-Reply-To: <1399315741.11780.36.camel@oct.suse.cz>
On Mon, May 05, 2014 at 08:49:01PM +0200, Stanislav Brabec wrote:
> Algorithm of calculation of hwclock adjustment is vulnerable to
> miscalculations. These miscalculations may lead to clock drifting by
> many years even after fixing CMOS hwclock failure.
>
> Following two patches are attempts to solve the most visible parts of
> the problem:
> - Calculation of excessive drift values in /etc/adjtime
> - Applying of excessive drift that causes many years clock failure.
> - It also prevents hangs before 4a44a54b.
Applied, thanks.
> There are further poor places in the code that are above the scope of
> this patch set:
> - Algorithm for detecting of invalid hwclock is very poor (valid_p fails
> only if hwclock output fails to pass mktime()).
> - There is no or failing discrimination between fine time adjustment and
> clock set.
> - In particular, proposed patch does not cover miscalculation while
> changing clock due to DST change, and more than 2 days passed since
> last adjustment. This could be covered by lowering of MAX_DRIFT, but
> heuristics for discrimination between adjustment and clock setting
> would be much better.
> - Most of failures fixed by these patches were hidden by a poor
> calculation of time passed since last adjustment:
> if ((hclocktime - adjtime_p->last_calib_time) < 23 * 60 * 60)
> (As there is no abs(), all times in past were considered as "less than
> one day ago".)
Look forward to see another patches ;-)
Karel
--
Karel Zak <kzak@redhat.com>
http://karelzak.blogspot.com
prev parent reply other threads:[~2014-05-06 10:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-05 18:49 [PATCH 0/2] hwclock: Fix excessive adjustment Stanislav Brabec
2014-05-06 10:56 ` Karel Zak [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140506105645.GN5962@x2.net.home \
--to=kzak@redhat.com \
--cc=sbrabec@suse.cz \
--cc=util-linux@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox