linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: vikram186@gmail.com (Vikram Narayanan)
To: linux-arm-kernel@lists.infradead.org
Subject: Architecture specific implementations for tickless kernel and deferrable timers
Date: Fri, 29 Apr 2011 19:56:56 +0530	[thread overview]
Message-ID: <BANLkTi=Xb7c9GeNJ_Our0+euEmumk_0-OA@mail.gmail.com> (raw)
In-Reply-To: <20110428182420.GF17290@n2100.arm.linux.org.uk>

On Thu, Apr 28, 2011 at 11:54 PM, Russell King - ARM Linux
<linux@arm.linux.org.uk> wrote:
> On Thu, Apr 28, 2011 at 10:59:01PM +0530, Vikram Narayanan wrote:
>> On Thu, Apr 28, 2011 at 7:58 PM, Russell King - ARM Linux
>> <linux@arm.linux.org.uk> wrote:
>> > What basically happens is:
>> >
>> > ? ? ? ?now = cs->read(cs);
>> > ? ? ? ?delta = (now - cs->cycle_last) & cs->mask;
>> > ? ? ? ?cs->cycle_last = now;
>> >
>> > ? ? ? ?ns = clocksource_cyc2ns(delta, cs...);
>> >
>> > ns now represents the amount of time which passed between this read and
>> > the previous read. ?Note the mask in the calculation of delta ensures
>> > that overflows are taken care of.
>>
>> The timekeeping_get_ns() in kernel/time/timekeeping.c takes care of the above.
>> So my job is to provide a good *continuous* clocksource with correct
>> mult,shift and mask values.
>> And also, the mult and shift values can be calculated from the
>> clocks_calc_mult_shift() function.
>
> For clocksources, please, no, don't use clocks_calc_mult_shift(). ?There
> is clocksource_register_hz() and clocksource_register_khz() which will
> sort out the shift and multiplier automatically for you.
Ok. I will use this.
>
>> The define HZ is important only for one-shot mode. and for a tickless
>> kernel this value is not of great importance.
>
> ITYM periodic mode.
Yes. in periodic mode. I mistyped it.
>
>> And also if I use the same timer for clocksource and clockevent, it
>> will surely gonna mess up my system's time sooner or latter.
>
> Indeed it will.
Can you also give some idea on how the system's RTC is hooked up with
the generic timekeeping code.
Is it hooked up in someway so that the walltime is calculated wrt the
initial value of the RTC?
>
>> > When you're called to switch to one-shot mode, program it for one-shot
>> > mode, disable it, and wait for set_next_event(). ?On set_next_event(),
>> > you program the timer to produce an interrupt after the specified
>> > interval and enable it.
>>
>> For the clockevent device, If I provide all the data structures,
>> next_event and set_mode, then this will work perfectly.
>>
>> Hope I have understood your explanations in the right way and all my
>> above statements make sense.
>
> I think so.
>
Thanks for your detailed explanations.
Will update this thread if I have more doubts on this.

Thanks,
Vikram

  reply	other threads:[~2011-04-29 14:26 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-20 18:15 Architecture specific implementations for tickless kernel and deferrable timers Vikram Narayanan
2011-04-22  3:13 ` Jeff Ohlstein
2011-04-24 14:20   ` Vikram Narayanan
2011-04-26 20:37     ` Russell King - ARM Linux
2011-04-27  3:30       ` Vikram Narayanan
2011-04-27  7:25         ` Russell King - ARM Linux
2011-04-27  8:17         ` Thomas Gleixner
2011-04-28 13:31           ` Vikram Narayanan
2011-04-28 13:38             ` Russell King - ARM Linux
2011-04-28 13:54               ` Vikram Narayanan
2011-04-28 14:28                 ` Russell King - ARM Linux
2011-04-28 17:29                   ` Vikram Narayanan
2011-04-28 18:24                     ` Russell King - ARM Linux
2011-04-29 14:26                       ` Vikram Narayanan [this message]
2011-04-29 14:34                         ` Russell King - ARM Linux
2011-04-29 15:07                           ` Vikram Narayanan
2011-04-29 17:05                             ` Thomas Gleixner
2011-04-29 17:05                           ` Thomas Gleixner
2011-04-29 17:57                             ` john stultz
2011-05-03  2:17                               ` Vikram Narayanan

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='BANLkTi=Xb7c9GeNJ_Our0+euEmumk_0-OA@mail.gmail.com' \
    --to=vikram186@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.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;
as well as URLs for NNTP newsgroup(s).