From: Johannes Weiner <hannes@cmpxchg.org>
To: Daniel Walker <dwalker@fifo99.com>
Cc: Johannes Weiner <jw@emlix.com>, Chris Zankel <chris@zankel.net>,
linux-kernel@vger.kernel.org
Subject: Re: [patch 3/3] xtensa: ccount clocksource
Date: Tue, 3 Mar 2009 20:54:01 +0100 [thread overview]
Message-ID: <20090303195401.GA2654@cmpxchg.org> (raw)
In-Reply-To: <1236102945.5937.1.camel@desktop>
On Tue, Mar 03, 2009 at 09:55:45AM -0800, Daniel Walker wrote:
> On Tue, 2009-03-03 at 16:30 +0100, Johannes Weiner wrote:
> > @ -29,6 +30,19 @@ unsigned long ccount_per_jiffy; /* per
> > unsigned long nsec_per_ccount; /* nsec per ccount increment
> > */
> > #endif
> >
> > +static cycle_t ccount_read(void)
> > +{
> > + return (cycle_t)get_ccount();
> > +}
> > +
> > +static struct clocksource ccount_clocksource = {
> > + .name = "ccount",
> > + .rating = 200,
> > + .read = ccount_read,
> > + .mask = CLOCKSOURCE_MASK(32),
> > + .mult = NSEC_PER_CCOUNT,
> > +};
>
> You don't want to use the shift field?
Thanks for pointing it out.
To make sure I understood this:
If shift is 0, then a walltime adjustment would be done in 1/2^0
steps, meaning an adjustment of counting one nanosecond more or less
per ccount.
To give this a finer granularity and smooth out adjustments, the shift
should be a trade-off between too much adjustment and no adjustment
progress in a sane amount of time (and, of course, to stay within
bounds of the used type).
Does that make sense?
I found a patch of yours that introduced clocksource_hz2shift() but it
seems it hasn't been merged (yet). Is it yet to get integrated?
Thanks in advance,
Hannes
next prev parent reply other threads:[~2009-03-03 19:54 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-03 15:30 [patch 0/3] xtensa generic time Johannes Weiner
2009-03-03 15:30 ` [patch 1/3] xtensa: use generic sched_clock() Johannes Weiner
2009-03-03 15:30 ` [patch 2/3] xtensa: remove platform rtc hooks Johannes Weiner
2009-03-03 15:30 ` [patch 3/3] xtensa: ccount clocksource Johannes Weiner
2009-03-03 17:55 ` Daniel Walker
2009-03-03 19:54 ` Johannes Weiner [this message]
2009-03-03 21:36 ` Daniel Walker
2009-03-04 20:26 ` Johannes Weiner
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=20090303195401.GA2654@cmpxchg.org \
--to=hannes@cmpxchg.org \
--cc=chris@zankel.net \
--cc=dwalker@fifo99.com \
--cc=jw@emlix.com \
--cc=linux-kernel@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