Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753586AbbHESNi (ORCPT ); Wed, 5 Aug 2015 14:13:38 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:29407 "EHLO mx0a-00082601.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752866AbbHESNh (ORCPT ); Wed, 5 Aug 2015 14:13:37 -0400 From: Shaohua Li To: CC: , John Stultz , Thomas Gleixner , Ingo Molnar Subject: [PATCH 2/2] clocksource: sanity check watchdog clocksource Date: Wed, 5 Aug 2015 11:12:54 -0700 Message-ID: X-Mailer: git-send-email 1.8.5.6 In-Reply-To: References: X-FB-Internal: Safe MIME-Version: 1.0 Content-Type: text/plain X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.14.151,1.0.33,0.0.0000 definitions=2015-08-05_10:2015-08-05,2015-08-05,1970-01-01 signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1201 Lines: 33 Add a sanity check to make sure watchdog clocksource doesn't wrap too quickly. Cc: John Stultz Cc: Thomas Gleixner Cc: Ingo Molnar Signed-off-by: Shaohua Li --- kernel/time/clocksource.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/time/clocksource.c b/kernel/time/clocksource.c index 8417c83..64e4629 100644 --- a/kernel/time/clocksource.c +++ b/kernel/time/clocksource.c @@ -327,7 +327,8 @@ static void clocksource_enqueue_watchdog(struct clocksource *cs) if (cs->flags & CLOCK_SOURCE_IS_CONTINUOUS) cs->flags |= CLOCK_SOURCE_VALID_FOR_HRES; /* Pick the best watchdog. */ - if (!watchdog || cs->rating > watchdog->rating) { + if (cs->max_idle_ns > WATCHDOG_MAX_INTERVAL_NS && + (!watchdog || cs->rating > watchdog->rating)) { watchdog = cs; /* Reset watchdog cycles */ clocksource_reset_watchdog(); -- 1.8.5.6 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/