From: David Mosberger <davidm@napali.hpl.hp.com>
To: linux-ia64@vger.kernel.org
Subject: Re: Next Revison of timer patches with split into nanosecond,
Date: Wed, 14 Jul 2004 01:57:25 +0000 [thread overview]
Message-ID: <16628.37637.516489.420207@napali.hpl.hp.com> (raw)
In-Reply-To: <Pine.LNX.4.58.0407131137160.3189@schroedinger.engr.sgi.com>
>>>>> On Tue, 13 Jul 2004 11:47:11 -0700 (PDT), Christoph Lameter <clameter@sgi.com> said:
Christoph> + do {
Christoph> + seq = read_seqbegin(&xtime_lock);
Christoph> + tv->tv_sec = xtime.tv_sec;
Christoph> + tv->tv_nsec = xtime.tv_nsec+time_interpolator_get_offset();
Christoph> + } while (unlikely(read_seqretry(&xtime_lock, seq)));
Christoph> +
Christoph> + while (unlikely(tv->tv_nsec >= NSEC_PER_SEC)) {
Christoph> + tv->tv_nsec -= NSEC_PER_SEC;
Christoph> + ++tv->tv_sec;
Christoph> + }
It'd be better to use local variables to calculate the sec/nsec values
and then do a pair of stores at the end to update tv->tv_sec and
tv->tv_nsec. The compiler most likely won't be able to use registers
otherwise (remember, the kernel gets compiled with
-fno-strict-aliasing!).
Some other comments:
- thanks for breaking the patch up into 3 pieces; it might be useful
to send the first one to lkml for discussion
- there is still a shortage of blanks around operators (e.g.,
assignment and arithmetic operators)
- the fsys.S code depends on depends on the layout of the
time_interpolator data-structure; that's OK, but it might be a good
idea to add some safe-guards which ensure that the code fails to
build if someone changes the layout of the structure
- the fsys.S portion of the patch didn't apply for me; may be a
problem on my end, given that it worked for Ken, but I'm out of
time for today, so no other comments on that part (again, sorry)
Thanks,
--david
next prev parent reply other threads:[~2004-07-14 1:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-07-13 18:47 Next Revison of timer patches with split into nanosecond, Christoph Lameter
2004-07-14 0:46 ` Next Revison of timer patches with split into nanosecond, time_interpolator and debug patch Chen, Kenneth W
2004-07-14 1:57 ` David Mosberger [this message]
2004-07-14 2:01 ` Matthew Wilcox
2004-07-14 2:06 ` Next Revison of timer patches with split into nanosecond, Christoph Lameter
2004-07-14 4:59 ` Next Revison of timer patches with split into nanosecond, time_interpolator and debug patch Chen, Kenneth W
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=16628.37637.516489.420207@napali.hpl.hp.com \
--to=davidm@napali.hpl.hp.com \
--cc=linux-ia64@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