mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Srivatsa Vaddagiri <vatsa@in.ibm.com>
To: Thomas Schlichter <thomas.schlichter@web.de>
Cc: john stultz <johnstul@us.ibm.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] Updated dynamic tick patches - Fix lost tick
Date: Thu, 1 Sep 2005 15:58:39 +0530	[thread overview]
Message-ID: <20050901102839.GB9936@in.ibm.com> (raw)
In-Reply-To: <200509010942.24026.thomas.schlichter@web.de>

On Thu, Sep 01, 2005 at 09:42:23AM +0200, Thomas Schlichter wrote:
> Think about two adjacent regular timer interrupts. Now consider the first one 
> is handled very late (indeed even after the second interrupt already 
> occoured). Then will see two "lost" ticks.
> 
> Now directly the second timer interrupt handler is executed and, well it sees 
> there has _nearly_ no time passed, so no "lost" ticks are reported.

Thomas,
	In such a case, we should not increment jiffie during second interrupt 
(mainline code increments jiffie always on a timer interrupt).

Also in such a case, it is probably not a good idea to drop offset_delay.
I think we should retain it - otherwise next tick will show up as zero ticks 
lost?). There is another complication that the offset_tick recorded during 
init_pmtmr may not be aligned on jiffy boundary. Ideally we want offset_tick 
to be aligned as closely as possible to jiffy boundary. This is one of the 
reason why I added setup_pit_timer in my patch during init_pmtmr.

After all this, I think the patch you sent out and what I had
sent are fundamentally same - they rely on some constant ticks per jiffy to be
seen for lost tick calculation. I have seen this works on some machines and 
not on others. I am trying to come up with another way of calculating
lost ticks, which partially depends on some known PMTMR_TICKS_PER_JIFFY
_and_ also reads the PIT to find out how late we are in processing
the interrupt (refer delay_at_last_interrupt calculation in timer_tsc.c).

Note that if you are testing mainline kernel, probably it wont test
the lost tick calculation code as much as dynamic tick does, since
not many ticks may be lost in practice. This could be one of the reasons 
why no one has probably complained about time drift bitterly in mainline! 
I would be much happy to accept a solution which works with dynamic tick. 
For this you will need to apply the set of patches I mailed out.


P.S : I think PMTMR_TICKS_PER_JIFFY has to be calculated differently,
      since a tick is not exactly 1/HZ of a second (see definition
      of LATCH and pm_ticks_per_jiffy in my patch).

-- 


Thanks and Regards,
Srivatsa Vaddagiri,
Linux Technology Center,
IBM Software Labs,
Bangalore, INDIA - 560017

  reply	other threads:[~2005-09-01 10:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-01  6:29 Thomas Schlichter
2005-09-01  7:23 ` Srivatsa Vaddagiri
2005-09-01  7:42   ` Thomas Schlichter
2005-09-01 10:28     ` Srivatsa Vaddagiri [this message]
2005-09-01 11:05       ` Thomas Schlichter
2005-09-01 11:33         ` Srivatsa Vaddagiri

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=20050901102839.GB9936@in.ibm.com \
    --to=vatsa@in.ibm.com \
    --cc=johnstul@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=thomas.schlichter@web.de \
    /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

all inboxes | Powered by JetHome®