From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932340AbbJ0NWs (ORCPT ); Tue, 27 Oct 2015 09:22:48 -0400 Received: from szxga03-in.huawei.com ([119.145.14.66]:20600 "EHLO szxga03-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932072AbbJ0NWr (ORCPT ); Tue, 27 Oct 2015 09:22:47 -0400 From: Yang Yingliang To: , CC: Yang Yingliang , Thomas Gleixner Subject: [PATCH 0/2] validate the delta of cycle_now and cycle_last on arm64 Date: Tue, 27 Oct 2015 21:21:11 +0800 Message-ID: <1445952073-7260-1-git-send-email-yangyingliang@huawei.com> X-Mailer: git-send-email 1.9.5.msysgit.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.177.19.219] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090201.562F7A5C.008F,ss=1,re=0.000,recu=0.000,reip=0.000,cl=1,cld=1,fgs=0, ip=0.0.0.0, so=2013-05-26 15:14:31, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: b4c5d4f8deec01419feaf050859a34ae Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 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