linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yang Yingliang <yangyingliang@huawei.com>
To: <linux-arm-kernel@lists.infradead.org>, <linux-kernel@vger.kernel.org>
Cc: Yang Yingliang <yangyingliang@huawei.com>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: [PATCH 0/2] validate the delta of cycle_now and cycle_last on arm64
Date: Tue, 27 Oct 2015 21:21:11 +0800	[thread overview]
Message-ID: <1445952073-7260-1-git-send-email-yangyingliang@huawei.com> (raw)

In multi-core system, if the clock is not sync perfectly, it
will make cycle_last that recorded by CPU-A is a little more
than cycle_now that read by CPU-B. With the negative result,
hrtimer_update_base() return a huge and wrong time. It leads
to the cpu can not finish the while loop in hrtimer_interrupt()
until the real nowtime which is returned from ktime_get() catch
up with the wrong time on clock monotonic base.

Fix it by select config CLOCKSOURCE_VALIDATE_LAST_CYCLE.

Cc: Thomas Gleixner <tglx@linutronix.de>

Yang Yingliang (2):
  clocksource: replace cycle_last validation with an equal way
  arm64: validate the cycle_last to prevent time going backwards

 arch/arm64/Kconfig                 | 1 +
 kernel/time/timekeeping_internal.h | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

-- 
2.5.0



             reply	other threads:[~2015-10-27 13:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-27 13:21 Yang Yingliang [this message]
2015-10-27 13:21 ` [PATCH 1/2] clocksource: replace cycle_last validation with an equal way Yang Yingliang
2015-10-30 14:56   ` Thomas Gleixner
2015-10-31 10:07     ` Yang Yingliang
2015-10-31 10:20     ` [PATCH resend] clocksource: modify the cycle_last validation to fit for non-64bit clocksourece mask Yang Yingliang
2015-12-19 15:03       ` [tip:timers/core] clocksource: Make clocksource validation work for all clocksources tip-bot for Yang Yingliang
2016-01-04 17:13         ` John Stultz
2015-10-27 13:21 ` [PATCH 2/2] arm64: validate the delta of cycle_now and cycle_last Yang Yingliang
2015-10-27 14:03   ` Mark Rutland
2015-10-28  1:33     ` Ding Tianhong
2015-10-29  7:36     ` Yang Yingliang
2015-10-29  8:31       ` Yang Yingliang

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=1445952073-7260-1-git-send-email-yangyingliang@huawei.com \
    --to=yangyingliang@huawei.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tglx@linutronix.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;
as well as URLs for NNTP newsgroup(s).